Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d33ab24 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Mark Brown
Browse files

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: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 96b96a74
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);