]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp
authorColin Ian King <colin.king@canonical.com>
Thu, 24 Oct 2019 12:46:10 +0000 (13:46 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 25 Oct 2019 10:05:47 +0000 (11:05 +0100)
commitb5587b7f0ec8362a813a9901b2df8758accb50a8
treeb6d14df605ddc541bb927f2457aa4dcb4ab7e185
parentc9f3e1608435edbc7e48f80a10edc1c18e990c31
ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp

The allocation of rt5677_dsp can potentially fail and return null, so add
a null check and return -ENOMEM on a memory allocation failure.

Addresses-Coverity: ("Dereference null return")
Fixes: 85f0d40d6e8d ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20191024124610.18182-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5677-spi.c