]> www.infradead.org Git - users/dwmw2/linux.git/commit
ASoC: rt5514-spi: Fix potential NULL pointer dereference
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 15 Jan 2019 17:57:23 +0000 (11:57 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 07:15:36 +0000 (08:15 +0100)
commit8fead3ecedcd462e870bf9bc32f9d3662061ec92
tree5ba8da7177131232841fcdc24ce6d79597a2834a
parentbfca4e001c0b19527f7a402313174aa4785bf738
ASoC: rt5514-spi: Fix potential NULL pointer dereference

commit 060d0bf491874daece47053c4e1fb0489eb867d2 upstream.

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")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/codecs/rt5514-spi.c