Skip to content

Commit c8b6f4a

Browse files
Pranjal Ramajor Asha Kanojiyaquic-jhugo
authored andcommitted
accel/qaic: Fix GEM import path code
Do not modify the size of dmabuf as it is immutable. Fixes: ff13be8 ("accel/qaic: Add datapath") Signed-off-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231208163101.1295769-2-quic_jhugo@quicinc.com
1 parent 6c9dbee commit c8b6f4a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/accel/qaic/qaic_data.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,6 @@ struct drm_gem_object *qaic_gem_prime_import(struct drm_device *dev, struct dma_
777777
struct dma_buf_attachment *attach;
778778
struct drm_gem_object *obj;
779779
struct qaic_bo *bo;
780-
size_t size;
781780
int ret;
782781

783782
bo = qaic_alloc_init_bo();
@@ -795,13 +794,12 @@ struct drm_gem_object *qaic_gem_prime_import(struct drm_device *dev, struct dma_
795794
goto attach_fail;
796795
}
797796

798-
size = PAGE_ALIGN(attach->dmabuf->size);
799-
if (size == 0) {
797+
if (!attach->dmabuf->size) {
800798
ret = -EINVAL;
801799
goto size_align_fail;
802800
}
803801

804-
drm_gem_private_object_init(dev, obj, size);
802+
drm_gem_private_object_init(dev, obj, attach->dmabuf->size);
805803
/*
806804
* skipping dma_buf_map_attachment() as we do not know the direction
807805
* just yet. Once the direction is known in the subsequent IOCTL to

0 commit comments

Comments
 (0)