* [PATCH] drm/v3d: remove second free in v3d_submit_cl_ioctl
@ 2020-07-20 13:56 trix
0 siblings, 0 replies; only message in thread
From: trix @ 2020-07-20 13:56 UTC (permalink / raw)
To: eric, airlied, daniel, itoral, navid.emamdoost
Cc: dri-devel, linux-kernel, Tom Rix
From: Tom Rix <trix@redhat.com>
clang static analysis reports this error
v3d_gem.c:573:4: warning: Attempt to free released
memory [unix.Malloc]
kfree(bin);
^~~~~~~~~~
Problem is in the block of code
if (ret) {
kfree(bin);
v3d_job_put(&render->base);
kfree(bin);
return ret;
}
Obviously bin is freed twice.
So remove one.
Fixes: 0d352a3a8a1f ("drm/v3d: don't leak bin job if v3d_job_init fails.")
Fixes: 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl")
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/gpu/drm/v3d/v3d_gem.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index 915f8bfdb58c..3cfbdb8e6a91 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -570,7 +570,6 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
if (ret) {
kfree(bin);
v3d_job_put(&render->base);
- kfree(bin);
return ret;
}
--
2.18.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-07-20 13:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 13:56 [PATCH] drm/v3d: remove second free in v3d_submit_cl_ioctl trix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome