lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 15 Jan 2019 11:57:23 -0600
From:   "Gustavo A. R. Silva" <>
To:     Bard Liao <>,
        Oder Chiou <>,
        Liam Girdwood <>,
        Mark Brown <>,
        Jaroslav Kysela <>, Takashi Iwai <>
        "Gustavo A. R. Silva" <>
Subject: [PATCH] ASoC: rt5514-spi: Fix potential NULL pointer dereference

There is a potential NULL pointer dereference in case devm_kzalloc()
fails and returns NULL.

Fix this by adding a NULL check on rt5514_dsp.

This issue was detected with the help of Coccinelle.

Fixes: 6eebf35b0e4a ("ASoC: rt5514: add rt5514 SPI driver")
Signed-off-by: Gustavo A. R. Silva <>
 sound/soc/codecs/rt5514-spi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
index 4d46f4567c3a..bec2eefa8b0f 100644
--- a/sound/soc/codecs/rt5514-spi.c
+++ b/sound/soc/codecs/rt5514-spi.c
@@ -280,6 +280,8 @@ static int rt5514_spi_pcm_probe(struct snd_soc_component *component)
 	rt5514_dsp = devm_kzalloc(component->dev, sizeof(*rt5514_dsp),
+	if (!rt5514_dsp)
+		return -ENOMEM;
 	rt5514_dsp->dev = &rt5514_spi->dev;

Powered by blists - more mailing lists