All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH V2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl
@ 2020-01-27  7:20 ` Markus Elfring
  0 siblings, 0 replies; 4+ 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] 4+ 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; 4+ 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: David Airlie, zhengbin, linux-kernel, Yi Zhang

> 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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH V2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl
@ 2019-12-30  1:40 ` yu kuai
  0 siblings, 0 replies; 4+ 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] 4+ messages in thread

* [PATCH V2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl
@ 2019-12-30  1:40 ` yu kuai
  0 siblings, 0 replies; 4+ messages in thread
From: yu kuai @ 2019-12-30  1:40 UTC (permalink / raw)
  To: eric, airlied, daniel.vetter, navid.emamdoost
  Cc: zhengbin13, yukuai3, linux-kernel, dri-devel, 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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

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

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.