diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-02-05 09:14:32 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-02-05 09:14:32 -0500 |
commit | 95601d65a1aa0902f838a2919e11ee6311efe371 (patch) | |
tree | ec7c23fc0a78732a1e9c7214b015bbff6be8df2a /drivers/base | |
parent | f88948eff9a6160ed74e3ee4b12f41f5beeff115 (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
86 | struct regmap_async_spi *async_spi; | 86 | struct regmap_async_spi *async_spi; |
87 | 87 | ||
88 | async_spi = kzalloc(sizeof(*async_spi), GFP_KERNEL); | 88 | async_spi = kzalloc(sizeof(*async_spi), GFP_KERNEL); |
89 | if (!async_spi) | ||
90 | return NULL; | ||
89 | 91 | ||
90 | return &async_spi->core; | 92 | return &async_spi->core; |
91 | } | 93 | } |