]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
accel/qaic: Fix slicing memory leak
authorPranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
Wed, 2 Aug 2023 14:59:37 +0000 (08:59 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Aug 2023 15:32:45 +0000 (17:32 +0200)
[ Upstream commit 2d956177b7c96e62fac762a3b7da4318cde27a73 ]

The temporary buffer storing slicing configuration data from user is only
freed on error.  This is a memory leak.  Free the buffer unconditionally.

Fixes: ff13be830333 ("accel/qaic: Add datapath")
Signed-off-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230802145937.14827-1-quic_jhugo@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/accel/qaic/qaic_data.c

index e9a1cb779b3056aedb3cb561926d5472aab56d11..6b6d981a71be7a1e6ed5c08b97de1357ba5cbe01 100644 (file)
@@ -1021,6 +1021,7 @@ int qaic_attach_slice_bo_ioctl(struct drm_device *dev, void *data, struct drm_fi
        bo->dbc = dbc;
        srcu_read_unlock(&dbc->ch_lock, rcu_id);
        drm_gem_object_put(obj);
+       kfree(slice_ent);
        srcu_read_unlock(&qdev->dev_lock, qdev_rcu_id);
        srcu_read_unlock(&usr->qddev_lock, usr_rcu_id);