mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
ASoC: mop500_ab8500: Add a NULL pointer check in mop500_ab8500_machine_init()
Avoid possible crash (NULL pointer dereference) by making sure that dem_kzalloc() is successful. Signed-off-by: Rajan Vaja <rajan.vaja@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
b787f68c36
commit
72f0095e79
@ -372,6 +372,10 @@ int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd)
|
||||
/* Create driver private-data struct */
|
||||
drvdata = devm_kzalloc(dev, sizeof(struct mop500_ab8500_drvdata),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!drvdata)
|
||||
return -ENOMEM;
|
||||
|
||||
snd_soc_card_set_drvdata(rtd->card, drvdata);
|
||||
|
||||
/* Setup clocks */
|
||||
|
Loading…
Reference in New Issue
Block a user