* [PATCH] ASoC: hdac_hdmi: fix possible NULL dereference
@ 2015-11-23 12:15 Sudip Mukherjee
2015-11-23 14:38 ` Applied "ASoC: hdac_hdmi: fix possible NULL dereference" to the asoc tree Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2015-11-23 12:15 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: linux-kernel, alsa-devel, Sudip Mukherjee
kzalloc() can return NULL if it fails, and then we will be dereferencing
a NULL pointer.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
sound/soc/codecs/hdac_hdmi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index d155262..205f2c2 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);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Applied "ASoC: hdac_hdmi: fix possible NULL dereference" to the asoc tree
2015-11-23 12:15 [PATCH] ASoC: hdac_hdmi: fix possible NULL dereference Sudip Mukherjee
@ 2015-11-23 14:38 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-11-23 14:38 UTC (permalink / raw)
To: Sudip Mukherjee, Mark Brown; +Cc: alsa-devel
The patch
ASoC: hdac_hdmi: fix possible NULL dereference
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 8d33ab24242c5ce2f8e4add8c04d5409e36a330c Mon Sep 17 00:00:00 2001
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: Mon, 23 Nov 2015 17:45:13 +0530
Subject: [PATCH] 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>
---
sound/soc/codecs/hdac_hdmi.c | 2 ++
1 file changed, 2 insertions(+)
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);
--
2.6.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-23 14:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23 12:15 [PATCH] ASoC: hdac_hdmi: fix possible NULL dereference Sudip Mukherjee
2015-11-23 14:38 ` Applied "ASoC: hdac_hdmi: fix possible NULL dereference" to the asoc tree Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).