From 95601d65a1aa0902f838a2919e11ee6311efe371 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 5 Feb 2013 14:14:32 +0000 Subject: regmap: spi: Handle allocation failures gracefully Signed-off-by: Mark Brown --- drivers/base/regmap/regmap-spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/regmap/regmap-spi.c b/drivers/base/regmap/regmap-spi.c index 913274b5f00..4c506bd940f 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; } -- cgit v1.2.3-70-g09d2