Skip to content

Commit e527adf

Browse files
tititiou36Shawn Guo
authored andcommitted
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: 0463269 ("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>
1 parent 0bb80ec commit e527adf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/firmware/imx/imx-dsp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
114114
dsp_chan->idx = i % 2;
115115
dsp_chan->ch = mbox_request_channel_byname(cl, chan_name);
116116
if (IS_ERR(dsp_chan->ch)) {
117+
kfree(dsp_chan->name);
117118
ret = PTR_ERR(dsp_chan->ch);
118119
if (ret != -EPROBE_DEFER)
119120
dev_err(dev, "Failed to request mbox chan %s ret %d\n",

0 commit comments

Comments
 (0)