From: Xiubo Li
Date: Thu, 9 Oct 2014 09:02:54 +0000 (+0800)
Subject: regmap: cache: fix errno in regcache_hw_init()
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ba3f1c85a6e05e0ff90215d817249617fcbee523;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git
regmap: cache: fix errno in regcache_hw_init()
When kmalloc() fails, we should return -ENOMEM.
Signed-off-by: Xiubo Li
Signed-off-by: Mark Brown
---
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 7558e6b01c04..6bec659e35d9 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -44,7 +44,7 @@ static int regcache_hw_init(struct regmap *map)
map->cache_bypass = 1;
tmp_buf = kmalloc(map->cache_size_raw, GFP_KERNEL);
if (!tmp_buf)
- return -EINVAL;
+ return -ENOMEM;
ret = regmap_raw_read(map, 0, tmp_buf,
map->num_reg_defaults_raw);
map->cache_bypass = cache_bypass;