summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-01-15 19:13:46 +0100
committerShawn Guo <shawnguo@kernel.org>2023-09-19 14:12:04 +0200
commite527adfb9b7d9d05a4577c116519e59a2bda4b05 (patch)
tree8c598f80b805924c7cf171952c4ce3e1b21930f7 /drivers/firmware
parent0bb80ecc33a8fb5a682236443c1e740d5c917d1d (diff)
downloadlinux-stable-e527adfb9b7d9d05a4577c116519e59a2bda4b05.tar.gz
linux-stable-e527adfb9b7d9d05a4577c116519e59a2bda4b05.tar.bz2
linux-stable-e527adfb9b7d9d05a4577c116519e59a2bda4b05.zip
firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
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> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/imx/imx-dsp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/firmware/imx/imx-dsp.c b/drivers/firmware/imx/imx-dsp.c
index 3dba590a2a95..508eab346fc6 100644
--- a/drivers/firmware/imx/imx-dsp.c
+++ b/drivers/firmware/imx/imx-dsp.c
@@ -114,6 +114,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",