Re: [PATCH] drm: Fix wrong kfree() in managed resource usage example

2020-04-02 Thread Daniel Vetter
On Thu, Apr 02, 2020 at 12:53:25PM +0300, Laurent Pinchart wrote:
> The example code showing how to use the managed resource API calls
> kfree() on the wrong pointer. Fix it.
> 
> Fixes: d33b58d0115e ("drm: Garbage collect drm_dev_fini")

Actually goes back to the original doc patch adding these, so I deleted
this line.

> Signed-off-by: Laurent Pinchart 

Thanks for your patch, applied to drm-misc-next.
-Daniel

> ---
>  drivers/gpu/drm/drm_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 7dad7813fca1..c15c9b4540e1 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -305,7 +305,7 @@ void drm_minor_release(struct drm_minor *minor)
>   *
>   *   ret = devm_drm_dev_init(>dev, drm, _drm_driver);
>   *   if (ret) {
> - *   kfree(drm);
> + *   kfree(priv);
>   *   return ret;
>   *   }
>   *   drmm_add_final_kfree(drm, priv);
> -- 
> Regards,
> 
> Laurent Pinchart
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm: Fix wrong kfree() in managed resource usage example

2020-04-02 Thread Laurent Pinchart
The example code showing how to use the managed resource API calls
kfree() on the wrong pointer. Fix it.

Fixes: d33b58d0115e ("drm: Garbage collect drm_dev_fini")
Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/drm_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 7dad7813fca1..c15c9b4540e1 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -305,7 +305,7 @@ void drm_minor_release(struct drm_minor *minor)
  *
  * ret = devm_drm_dev_init(>dev, drm, _drm_driver);
  * if (ret) {
- * kfree(drm);
+ * kfree(priv);
  * return ret;
  * }
  * drmm_add_final_kfree(drm, priv);
-- 
Regards,

Laurent Pinchart

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