mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
ASoC: dapm: Fix NULL pointer dereference in snd_soc_dapm_free_kcontrol
[ Upstream commit cacea3a90e ]
w_text_param can be NULL and it is being dereferenced without checking.
Add the missing sanity check to prevent NULL pointer dereference.
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6f69661f6e
commit
d356db0883
@@ -3847,6 +3847,10 @@ snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
|
||||
int count;
|
||||
|
||||
devm_kfree(card->dev, (void *)*private_value);
|
||||
|
||||
if (!w_param_text)
|
||||
return;
|
||||
|
||||
for (count = 0 ; count < num_params; count++)
|
||||
devm_kfree(card->dev, (void *)w_param_text[count]);
|
||||
devm_kfree(card->dev, w_param_text);
|
||||
|
||||
Reference in New Issue
Block a user