dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl()
@ 2020-06-01 12:32 yu kuai
  2020-06-09 14:19 ` yukuai (C)
  0 siblings, 1 reply; 2+ messages in thread
From: yu kuai @ 2020-06-01 12:32 UTC (permalink / raw)
  To: eric, airlied, daniel, navid.emamdoost; +Cc: yukuai3, dri-devel, yi.zhang

kfree() is called twice for the same variable 'bin', the first is
introduced in commit 0d352a3a8a1f ("drm/v3d: don't leak bin job if
v3d_job_init fails."), while the second is introduced in
commit 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl").
The latter one should fail since there is a conflict, however, it got
merged somehow.

Fix it by removing the function call which is introduced later.

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..271567600921 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.25.4

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

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

* Re: [PATCH 1/2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl()
  2020-06-01 12:32 [PATCH 1/2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl() yu kuai
@ 2020-06-09 14:19 ` yukuai (C)
  0 siblings, 0 replies; 2+ messages in thread
From: yukuai (C) @ 2020-06-09 14:19 UTC (permalink / raw)
  To: eric, airlied, daniel, navid.emamdoost; +Cc: dri-devel, yi.zhang

ping ?

On 2020/6/1 20:32, yu kuai wrote:
> kfree() is called twice for the same variable 'bin', the first is
> introduced in commit 0d352a3a8a1f ("drm/v3d: don't leak bin job if
> v3d_job_init fails."), while the second is introduced in
> commit 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl").
> The latter one should fail since there is a conflict, however, it got
> merged somehow.
> 
> Fix it by removing the function call which is introduced later.
> 
> 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..271567600921 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;
>   		}
>   
> 

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

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

end of thread, other threads:[~2020-06-10  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01 12:32 [PATCH 1/2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl() yu kuai
2020-06-09 14:19 ` yukuai (C)

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).