diff mbox series

drm/v3d: don't leak bin job if v3d_job_init fails.

Message ID 20190916071125.5255-1-itoral@igalia.com (mailing list archive)
State New, archived
Headers show
Series drm/v3d: don't leak bin job if v3d_job_init fails. | expand

Commit Message

Iago Toral Sept. 16, 2019, 7:11 a.m. UTC
If the initialization of the job fails we need to kfree() it
before returning.

Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
---
 drivers/gpu/drm/v3d/v3d_gem.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Eric Anholt Sept. 18, 2019, 5:41 p.m. UTC | #1
Iago Toral Quiroga <itoral@igalia.com> writes:

> If the initialization of the job fails we need to kfree() it
> before returning.
>
> Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>

Applied to drm-misc-next with a fixes tag for the commit that introduced
the bug.  Thanks!
diff mbox series

Patch

diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index d46d91346d09..ed68731404a7 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -566,6 +566,7 @@  v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
 		ret = v3d_job_init(v3d, file_priv, &bin->base,
 				   v3d_job_free, args->in_sync_bcl);
 		if (ret) {
+			kfree(bin);
 			v3d_job_put(&render->base);
 			return ret;
 		}