linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] firmware: imx: scu: Fix possible memory leak in imx_scu_probe()
@ 2020-05-06  5:14 Wei Yongjun
  2020-05-06 11:02 ` Aisheng Dong
  2020-05-20  1:15 ` Shawn Guo
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2020-05-06  5:14 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Dong Aisheng
  Cc: Wei Yongjun, linux-arm-kernel, linux-kernel, kernel-janitors

'chan_name' is malloced in imx_scu_probe() and should be freed
before leaving from the error handling cases, otherwise it will
cause memory leak.

Fixes: edbee095fafb ("firmware: imx: add SCU firmware driver support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/firmware/imx/imx-scu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/imx/imx-scu.c b/drivers/firmware/imx/imx-scu.c
index b3da2e193ad2..176ddd151375 100644
--- a/drivers/firmware/imx/imx-scu.c
+++ b/drivers/firmware/imx/imx-scu.c
@@ -314,6 +314,7 @@ static int imx_scu_probe(struct platform_device *pdev)
 			if (ret != -EPROBE_DEFER)
 				dev_err(dev, "Failed to request mbox chan %s ret %d\n",
 					chan_name, ret);
+			kfree(chan_name);
 			return ret;
 		}




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

* RE: [PATCH -next] firmware: imx: scu: Fix possible memory leak in imx_scu_probe()
  2020-05-06  5:14 [PATCH -next] firmware: imx: scu: Fix possible memory leak in imx_scu_probe() Wei Yongjun
@ 2020-05-06 11:02 ` Aisheng Dong
  2020-05-20  1:15 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Aisheng Dong @ 2020-05-06 11:02 UTC (permalink / raw)
  To: Wei Yongjun, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, dl-linux-imx
  Cc: linux-arm-kernel, linux-kernel, kernel-janitors

> From: Wei Yongjun <weiyongjun1@huawei.com>
> Sent: Wednesday, May 6, 2020 1:14 PM
> 
> 'chan_name' is malloced in imx_scu_probe() and should be freed before leaving
> from the error handling cases, otherwise it will cause memory leak.
> 
> Fixes: edbee095fafb ("firmware: imx: add SCU firmware driver support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Thanks for the fix.
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Aisheng

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

* Re: [PATCH -next] firmware: imx: scu: Fix possible memory leak in imx_scu_probe()
  2020-05-06  5:14 [PATCH -next] firmware: imx: scu: Fix possible memory leak in imx_scu_probe() Wei Yongjun
  2020-05-06 11:02 ` Aisheng Dong
@ 2020-05-20  1:15 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2020-05-20  1:15 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Dong Aisheng, linux-arm-kernel, linux-kernel,
	kernel-janitors

On Wed, May 06, 2020 at 05:14:10AM +0000, Wei Yongjun wrote:
> 'chan_name' is malloced in imx_scu_probe() and should be freed
> before leaving from the error handling cases, otherwise it will
> cause memory leak.
> 
> Fixes: edbee095fafb ("firmware: imx: add SCU firmware driver support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied, thanks.

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

end of thread, other threads:[~2020-05-20  1:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06  5:14 [PATCH -next] firmware: imx: scu: Fix possible memory leak in imx_scu_probe() Wei Yongjun
2020-05-06 11:02 ` Aisheng Dong
2020-05-20  1:15 ` Shawn Guo

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