From: Mark Brown Date: Tue, 5 Feb 2013 14:14:32 +0000 (+0000) Subject: regmap: spi: Handle allocation failures gracefully X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=95601d65a1aa0902f838a2919e11ee6311efe371;p=linux-beck.git regmap: spi: Handle allocation failures gracefully Signed-off-by: Mark Brown --- diff --git a/drivers/base/regmap/regmap-spi.c b/drivers/base/regmap/regmap-spi.c index 913274b5f00a..4c506bd940f3 100644 --- a/drivers/base/regmap/regmap-spi.c +++ b/drivers/base/regmap/regmap-spi.c @@ -86,6 +86,8 @@ static struct regmap_async *regmap_spi_async_alloc(void) struct regmap_async_spi *async_spi; async_spi = kzalloc(sizeof(*async_spi), GFP_KERNEL); + if (!async_spi) + return NULL; return &async_spi->core; }