lkml.org 
[lkml]   [2021]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] remoteproc: imx_rproc: Fix a resource leak in the remove function
On Wed, 10 Nov 2021 at 01:54, Peng Fan <peng.fan@nxp.com> wrote:
>
> > Subject: [PATCH] remoteproc: imx_rproc: Fix a resource leak in the remove
> > function
> >
> > 'priv->workqueue' is destroyed in the error handling path of the probe but not
> > in the remove function.
> >
> > Add the missing call to release some resources.
> >
> > Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox")
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> Reviewed-and-Tested-by: Peng Fan <peng.fan@nxp.com>
>

Thank you for that - I will pick up this patch when -rc1 or -rc2 gets released.

Thanks,
Mathieu

> > ---
> > This patch is speculative. I'm not sure if the added function call is at the right
> > place in the remove function.
> > Review with care.
> > ---
> > drivers/remoteproc/imx_rproc.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/remoteproc/imx_rproc.c
> > b/drivers/remoteproc/imx_rproc.c index ff8170dbbc3c..0a45bc0d3f73
> > 100644
> > --- a/drivers/remoteproc/imx_rproc.c
> > +++ b/drivers/remoteproc/imx_rproc.c
> > @@ -804,6 +804,7 @@ static int imx_rproc_remove(struct platform_device
> > *pdev)
> > clk_disable_unprepare(priv->clk);
> > rproc_del(rproc);
> > imx_rproc_free_mbox(rproc);
> > + destroy_workqueue(priv->workqueue);
> > rproc_free(rproc);
> >
> > return 0;
> > --
> > 2.30.2
>

\
 
 \ /
  Last update: 2021-11-11 19:21    [W:0.124 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site