提交 ba3f1c85 编写于 作者: X Xiubo Li 提交者: Mark Brown

regmap: cache: fix errno in regcache_hw_init()

When kmalloc() fails, we should return -ENOMEM.
Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 5bd83ed0
...@@ -44,7 +44,7 @@ static int regcache_hw_init(struct regmap *map) ...@@ -44,7 +44,7 @@ static int regcache_hw_init(struct regmap *map)
map->cache_bypass = 1; map->cache_bypass = 1;
tmp_buf = kmalloc(map->cache_size_raw, GFP_KERNEL); tmp_buf = kmalloc(map->cache_size_raw, GFP_KERNEL);
if (!tmp_buf) if (!tmp_buf)
return -EINVAL; return -ENOMEM;
ret = regmap_raw_read(map, 0, tmp_buf, ret = regmap_raw_read(map, 0, tmp_buf,
map->num_reg_defaults_raw); map->num_reg_defaults_raw);
map->cache_bypass = cache_bypass; map->cache_bypass = cache_bypass;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册