regmap: spi: Handle allocation failures gracefully

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Mark Brown 2013-02-05 14:14:32 +00:00
parent f88948eff9
commit 95601d65a1
1 changed files with 2 additions and 0 deletions

View 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;
}