Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad5a06e1 authored by Kamil Duljas's avatar Kamil Duljas Committed by Greg Kroah-Hartman
Browse files

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



[ Upstream commit d5c65be34df73fa01ed05611aafb73b440d89e29 ]

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.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 57a95d06
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -260,8 +260,10 @@ static int skl_pcm_open(struct snd_pcm_substream *substream,
	snd_pcm_set_sync(substream);

	mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream);
	if (!mconfig)
	if (!mconfig) {
		kfree(dma_params);
		return -EINVAL;
	}

	skl_tplg_d0i3_get(skl, mconfig->d0i3_caps);

+3 −1
Original line number Diff line number Diff line
@@ -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;
	buf = krealloc(reply.data, reply.size, GFP_KERNEL);
	if (!buf)
	if (!buf) {
		kfree(reply.data);
		return -ENOMEM;
	}
	*payload = buf;
	*bytes = reply.size;