All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
@ 2023-01-15 18:13 ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2023-01-15 18:13 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Daniel Baluta, Paul Olaru
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-arm-kernel

If mbox_request_channel_byname() fails, the memory allocated a few lines
above still need to be freed before going to the error handling path.

Fixes: 046326989a18 ("firmware: imx: Save channel name for further use")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
The Fixes tag is not really accurate, the issue was already there before,
with other emory leaks.
However, I think that the Fixes tag above is much more logical.

Feel free to update!
---
 drivers/firmware/imx/imx-dsp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/imx/imx-dsp.c b/drivers/firmware/imx/imx-dsp.c
index a6c06d7476c3..1f410809d3ee 100644
--- a/drivers/firmware/imx/imx-dsp.c
+++ b/drivers/firmware/imx/imx-dsp.c
@@ -115,6 +115,7 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
 		dsp_chan->idx = i % 2;
 		dsp_chan->ch = mbox_request_channel_byname(cl, chan_name);
 		if (IS_ERR(dsp_chan->ch)) {
+			kfree(dsp_chan->name);
 			ret = PTR_ERR(dsp_chan->ch);
 			if (ret != -EPROBE_DEFER)
 				dev_err(dev, "Failed to request mbox chan %s ret %d\n",
-- 
2.34.1


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

* [PATCH] firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
@ 2023-01-15 18:13 ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2023-01-15 18:13 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Daniel Baluta, Paul Olaru
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-arm-kernel

If mbox_request_channel_byname() fails, the memory allocated a few lines
above still need to be freed before going to the error handling path.

Fixes: 046326989a18 ("firmware: imx: Save channel name for further use")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
The Fixes tag is not really accurate, the issue was already there before,
with other emory leaks.
However, I think that the Fixes tag above is much more logical.

Feel free to update!
---
 drivers/firmware/imx/imx-dsp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/imx/imx-dsp.c b/drivers/firmware/imx/imx-dsp.c
index a6c06d7476c3..1f410809d3ee 100644
--- a/drivers/firmware/imx/imx-dsp.c
+++ b/drivers/firmware/imx/imx-dsp.c
@@ -115,6 +115,7 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
 		dsp_chan->idx = i % 2;
 		dsp_chan->ch = mbox_request_channel_byname(cl, chan_name);
 		if (IS_ERR(dsp_chan->ch)) {
+			kfree(dsp_chan->name);
 			ret = PTR_ERR(dsp_chan->ch);
 			if (ret != -EPROBE_DEFER)
 				dev_err(dev, "Failed to request mbox chan %s ret %d\n",
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
  2023-01-15 18:13 ` Christophe JAILLET
@ 2023-01-17  7:55   ` Daniel Baluta
  -1 siblings, 0 replies; 8+ messages in thread
From: Daniel Baluta @ 2023-01-17  7:55 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Daniel Baluta, Paul Olaru, linux-kernel,
	kernel-janitors, linux-arm-kernel

On Sun, Jan 15, 2023 at 8:35 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> If mbox_request_channel_byname() fails, the memory allocated a few lines
> above still need to be freed before going to the error handling path.
>
> Fixes: 046326989a18 ("firmware: imx: Save channel name for further use")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Good catch.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>

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

* Re: [PATCH] firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
@ 2023-01-17  7:55   ` Daniel Baluta
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Baluta @ 2023-01-17  7:55 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Daniel Baluta, Paul Olaru, linux-kernel,
	kernel-janitors, linux-arm-kernel

On Sun, Jan 15, 2023 at 8:35 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> If mbox_request_channel_byname() fails, the memory allocated a few lines
> above still need to be freed before going to the error handling path.
>
> Fixes: 046326989a18 ("firmware: imx: Save channel name for further use")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Good catch.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
  2023-01-17  7:55   ` Daniel Baluta
@ 2023-08-20  6:26     ` Christophe JAILLET
  -1 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2023-08-20  6:26 UTC (permalink / raw)
  To: Daniel Baluta
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Daniel Baluta, Paul Olaru, linux-kernel,
	kernel-janitors, linux-arm-kernel

Le 17/01/2023 à 08:55, Daniel Baluta a écrit :
> On Sun, Jan 15, 2023 at 8:35 PM Christophe JAILLET
> <christophe.jaillet@wanadoo.fr> wrote:
>>
>> If mbox_request_channel_byname() fails, the memory allocated a few lines
>> above still need to be freed before going to the error handling path.
>>
>> Fixes: 046326989a18 ("firmware: imx: Save channel name for further use")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> Good catch.
> 
> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
> 

Hi,

polite reminder.

This patch is still not in -next.

CJ

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
@ 2023-08-20  6:26     ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2023-08-20  6:26 UTC (permalink / raw)
  To: Daniel Baluta
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Daniel Baluta, Paul Olaru, linux-kernel,
	kernel-janitors, linux-arm-kernel

Le 17/01/2023 à 08:55, Daniel Baluta a écrit :
> On Sun, Jan 15, 2023 at 8:35 PM Christophe JAILLET
> <christophe.jaillet@wanadoo.fr> wrote:
>>
>> If mbox_request_channel_byname() fails, the memory allocated a few lines
>> above still need to be freed before going to the error handling path.
>>
>> Fixes: 046326989a18 ("firmware: imx: Save channel name for further use")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> Good catch.
> 
> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
> 

Hi,

polite reminder.

This patch is still not in -next.

CJ

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

* Re: [PATCH] firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
  2023-08-20  6:26     ` Christophe JAILLET
@ 2023-09-19 12:13       ` Shawn Guo
  -1 siblings, 0 replies; 8+ messages in thread
From: Shawn Guo @ 2023-09-19 12:13 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Daniel Baluta, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Daniel Baluta, Paul Olaru,
	linux-kernel, kernel-janitors, linux-arm-kernel

On Sun, Aug 20, 2023 at 08:26:01AM +0200, Christophe JAILLET wrote:
> Le 17/01/2023 à 08:55, Daniel Baluta a écrit :
> > On Sun, Jan 15, 2023 at 8:35 PM Christophe JAILLET
> > <christophe.jaillet@wanadoo.fr> wrote:
> > > 
> > > If mbox_request_channel_byname() fails, the memory allocated a few lines
> > > above still need to be freed before going to the error handling path.
> > > 
> > > Fixes: 046326989a18 ("firmware: imx: Save channel name for further use")
> > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > 
> > Good catch.
> > 
> > Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
> > 
> 
> Hi,
> 
> polite reminder.
> 
> This patch is still not in -next.

Sorry, not sure how this fell from the crack.

Applied, thanks!

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

* Re: [PATCH] firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
@ 2023-09-19 12:13       ` Shawn Guo
  0 siblings, 0 replies; 8+ messages in thread
From: Shawn Guo @ 2023-09-19 12:13 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Daniel Baluta, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Daniel Baluta, Paul Olaru,
	linux-kernel, kernel-janitors, linux-arm-kernel

On Sun, Aug 20, 2023 at 08:26:01AM +0200, Christophe JAILLET wrote:
> Le 17/01/2023 à 08:55, Daniel Baluta a écrit :
> > On Sun, Jan 15, 2023 at 8:35 PM Christophe JAILLET
> > <christophe.jaillet@wanadoo.fr> wrote:
> > > 
> > > If mbox_request_channel_byname() fails, the memory allocated a few lines
> > > above still need to be freed before going to the error handling path.
> > > 
> > > Fixes: 046326989a18 ("firmware: imx: Save channel name for further use")
> > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > 
> > Good catch.
> > 
> > Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
> > 
> 
> Hi,
> 
> polite reminder.
> 
> This patch is still not in -next.

Sorry, not sure how this fell from the crack.

Applied, thanks!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-09-19 12:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-15 18:13 [PATCH] firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels() Christophe JAILLET
2023-01-15 18:13 ` Christophe JAILLET
2023-01-17  7:55 ` Daniel Baluta
2023-01-17  7:55   ` Daniel Baluta
2023-08-20  6:26   ` Christophe JAILLET
2023-08-20  6:26     ` Christophe JAILLET
2023-09-19 12:13     ` Shawn Guo
2023-09-19 12:13       ` Shawn Guo

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.