Skip to content

Commit

Permalink
regmap: spi: Handle allocation failures gracefully
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Feb 5, 2013
1 parent f88948e commit 95601d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/base/regmap/regmap-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 95601d6

Please sign in to comment.