提交 8d33ab24 编写于 作者: S Sudip Mukherjee 提交者: Mark Brown

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: NSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 96b96a74
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册