mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 22:53:55 +08:00
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>
This commit is contained in:
parent
96b96a743c
commit
8d33ab2424
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user