]> git.karo-electronics.de Git - linux-beck.git/commitdiff
regmap: spi: Handle allocation failures gracefully
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 5 Feb 2013 14:14:32 +0000 (14:14 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 5 Feb 2013 14:14:32 +0000 (14:14 +0000)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regmap-spi.c

index 913274b5f00a0dc11893bf40ef79416765712f8c..4c506bd940f372b8bbe3b630a9599ca52ea745bf 100644 (file)
@@ -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;
 }