diff options
| author | Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com> | 2023-12-08 09:31:00 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-10 17:16:47 +0100 |
| commit | efcedd56998b4f863fdd76740f65cb49f7dc8e2b (patch) | |
| tree | 49aad9dd51cf29c37e6fb0e1642e3d28a3eb7c07 /drivers/accel | |
| parent | 30912a7f64de49408c9c0596937717770f1e7a63 (diff) | |
| download | linux-efcedd56998b4f863fdd76740f65cb49f7dc8e2b.tar.gz linux-efcedd56998b4f863fdd76740f65cb49f7dc8e2b.tar.bz2 linux-efcedd56998b4f863fdd76740f65cb49f7dc8e2b.zip | |
accel/qaic: Fix GEM import path code
[ Upstream commit c8b6f4ad2ff9c6d88cdeb9acf16d0c4a323dd499 ]
Do not modify the size of dmabuf as it is immutable.
Fixes: ff13be830333 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/accel')
| -rw-r--r-- | drivers/accel/qaic/qaic_data.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c index f4b06792c6f1..ed1a5af434f2 100644 --- a/drivers/accel/qaic/qaic_data.c +++ b/drivers/accel/qaic/qaic_data.c @@ -766,7 +766,6 @@ struct drm_gem_object *qaic_gem_prime_import(struct drm_device *dev, struct dma_ struct dma_buf_attachment *attach; struct drm_gem_object *obj; struct qaic_bo *bo; - size_t size; int ret; bo = qaic_alloc_init_bo(); @@ -784,13 +783,12 @@ struct drm_gem_object *qaic_gem_prime_import(struct drm_device *dev, struct dma_ goto attach_fail; } - size = PAGE_ALIGN(attach->dmabuf->size); - if (size == 0) { + if (!attach->dmabuf->size) { ret = -EINVAL; goto size_align_fail; } - drm_gem_private_object_init(dev, obj, size); + drm_gem_private_object_init(dev, obj, attach->dmabuf->size); /* * skipping dma_buf_map_attachment() as we do not know the direction * just yet. Once the direction is known in the subsequent IOCTL to |
