diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-11-23 17:45:13 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-11-23 14:38:08 +0000 |
commit | 8d33ab24242c5ce2f8e4add8c04d5409e36a330c (patch) | |
tree | 42e3552a20fe84f101fb86ca8f2c96e0094bf52b /sound/soc/codecs/hdac_hdmi.c | |
parent | 96b96a743c65969ebf13c343837db2faff1a8a84 (diff) | |
download | lwn-8d33ab24242c5ce2f8e4add8c04d5409e36a330c.tar.gz lwn-8d33ab24242c5ce2f8e4add8c04d5409e36a330c.zip |
ASoC: hdac_hdmi: fix possible NULL dereference
kzalloc() can return NULL if it fails, and then we will be dereferencing
a NULL pointer.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/hdac_hdmi.c')
-rw-r--r-- | sound/soc/codecs/hdac_hdmi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index d1552620257f..205f2c27263d 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -200,6 +200,8 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream, } dd = kzalloc(sizeof(*dd), GFP_KERNEL); + if (!dd) + return -ENOMEM; dd->format = snd_hdac_calc_stream_format(params_rate(hparams), params_channels(hparams), params_format(hparams), 24, 0); |