diff options
| author | Linkai Gong <gonglinkai@kylinos.cn> | 2026-08-13 17:58:18 +0800 |
|---|---|---|
| committer | Frank Li <Frank.Li@nxp.com> | 2026-09-14 15:38:00 -0400 |
| commit | e3631d0242842940f9e902afaea98202e56277e8 (patch) | |
| tree | 4fd310b2c6c3710e98c573ee881006d6c212c6d7 | |
| parent | cee9395acd8043be0644b25c34bfa86623f2b935 (diff) | |
| download | linux-next-e3631d0242842940f9e902afaea98202e56277e8.tar.gz linux-next-e3631d0242842940f9e902afaea98202e56277e8.zip | |
firmware: imx: dsp: fix mailbox channel leak on kasprintf failure
If kasprintf() fails while setting up mailbox channels, already
requested channels from earlier iterations were never freed. Route
the failure through the existing cleanup path.
Fixes: ffbf23d50353 ("firmware: imx: Add DSP IPC protocol interface")
Signed-off-by: Linkai Gong <gonglinkai@kylinos.cn>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
| -rw-r--r-- | drivers/firmware/imx/imx-dsp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firmware/imx/imx-dsp.c b/drivers/firmware/imx/imx-dsp.c index ed79e823157a..7e3f45ddf0c1 100644 --- a/drivers/firmware/imx/imx-dsp.c +++ b/drivers/firmware/imx/imx-dsp.c @@ -99,8 +99,10 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc) else chan_name = kasprintf(GFP_KERNEL, "rxdb%d", i - 2); - if (!chan_name) - return -ENOMEM; + if (!chan_name) { + ret = -ENOMEM; + goto out; + } dsp_chan = &dsp_ipc->chans[i]; dsp_chan->name = chan_name; |
