summaryrefslogtreecommitdiff
path: root/drivers/firmware/imx
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-01-15 21:13:46 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-06 14:16:04 +0300
commit50d14cd5a67e3120e18baf3cf6c7b70db2f90027 (patch)
treeb25ef10f6e35b3bb7c008f79c4233e802e75ade0 /drivers/firmware/imx
parentd9b092769b58d931604bcdeadee6a2cd96755f59 (diff)
downloadlinux-50d14cd5a67e3120e18baf3cf6c7b70db2f90027.tar.xz
firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()
[ Upstream commit e527adfb9b7d9d05a4577c116519e59a2bda4b05 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/firmware/imx')
-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 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",