Commit d5c65be3 authored by Kamil Duljas's avatar Kamil Duljas Committed by Mark Brown

ASoC: Intel: Skylake: Fix mem leak in few functions

The resources should be freed when function return error.
Signed-off-by: default avatarKamil Duljas <kamil.duljas@gmail.com>
Reviewed-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231116125150.1436-1-kamil.duljas@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 37e6fd0c
...@@ -240,8 +240,10 @@ static int skl_pcm_open(struct snd_pcm_substream *substream, ...@@ -240,8 +240,10 @@ static int skl_pcm_open(struct snd_pcm_substream *substream,
snd_pcm_set_sync(substream); snd_pcm_set_sync(substream);
mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream); mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream);
if (!mconfig) if (!mconfig) {
kfree(dma_params);
return -EINVAL; return -EINVAL;
}
skl_tplg_d0i3_get(skl, mconfig->d0i3_caps); skl_tplg_d0i3_get(skl, mconfig->d0i3_caps);
......
...@@ -1003,8 +1003,10 @@ int skl_ipc_get_large_config(struct sst_generic_ipc *ipc, ...@@ -1003,8 +1003,10 @@ int skl_ipc_get_large_config(struct sst_generic_ipc *ipc,
reply.size = (reply.header >> 32) & IPC_DATA_OFFSET_SZ_MASK; reply.size = (reply.header >> 32) & IPC_DATA_OFFSET_SZ_MASK;
buf = krealloc(reply.data, reply.size, GFP_KERNEL); buf = krealloc(reply.data, reply.size, GFP_KERNEL);
if (!buf) if (!buf) {
kfree(reply.data);
return -ENOMEM; return -ENOMEM;
}
*payload = buf; *payload = buf;
*bytes = reply.size; *bytes = reply.size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment