aboutsummaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-05 14:14:32 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-05 14:14:32 +0000
commit95601d65a1aa0902f838a2919e11ee6311efe371 (patch)
treeec7c23fc0a78732a1e9c7214b015bbff6be8df2a /drivers/base
parentf88948eff9a6160ed74e3ee4b12f41f5beeff115 (diff)
regmap: spi: Handle allocation failures gracefully
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regmap-spi.c2
1 files changed, 2 insertions, 0 deletions
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;
}