OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96b96a7
)
ASoC: hdac_hdmi: fix possible NULL dereference
author
Sudip Mukherjee
<sudipm.mukherjee@gmail.com>
Mon, 23 Nov 2015 12:15:13 +0000
(17:45 +0530)
committer
Mark Brown
<broonie@kernel.org>
Mon, 23 Nov 2015 14:38:08 +0000
(14:38 +0000)
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>
sound/soc/codecs/hdac_hdmi.c
patch
|
blob
|
history
diff --git
a/sound/soc/codecs/hdac_hdmi.c
b/sound/soc/codecs/hdac_hdmi.c
index
d155262
..
205f2c2
100644
(file)
--- 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);