linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl
@ 2019-12-30  1:40 yu kuai
  0 siblings, 0 replies; 2+ messages in thread
From: yu kuai @ 2019-12-30  1:40 UTC (permalink / raw)
  To: eric, airlied, daniel.vetter, navid.emamdoost
  Cc: dri-devel, linux-kernel, yukuai3, zhengbin13, yi.zhang

kfree() was called for the same variable twice within an if branch.

Fix it by deleting a duplicate function call.

Fixes: 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl")
Signed-off-by: yu kuai <yukuai3@huawei.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 549dde83408b..37515e47b47e 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -568,7 +568,6 @@ 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);
 			kfree(bin);
 			return ret;
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl
@ 2020-01-27  7:20 Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2020-01-27  7:20 UTC (permalink / raw)
  To: Yu Kuai, Daniel Vetter, Eric Anholt, Navid Emamdoost, dri-devel
  Cc: linux-kernel, David Airlie, Yi Zhang, zhengbin

> kfree() was called for the same variable twice within an if branch.

I wonder still how this software situation happened.


Now I imagine that it could be more logical to delete the second of
this function call if you would like to look at the history of previous
two patches once more.


How do you think about to add another jump target for a bit of common
exception handling?

Regards,
Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-27  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-30  1:40 [PATCH V2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl yu kuai
2020-01-27  7:20 Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).