regmap: Fix 'ret' would return an uninitialized value
This patch give a warning when calling regmap_register_patch with parameter num_regs <= 0. When the num_regs parameter is zero and krealloc doesn't fail, then the code would return an uninitialized value. However, calling this function with num_regs == 0, would be a waste as it essentially does nothing. Signed-off-by: NCai Zhiyong <caizhiyong@huawei.com> Reviewed-by: NGeyslan G. Bem <geyslan@gmail.com> Signed-off-by: NMark Brown <broonie@linaro.org>
Showing
想要评论请 注册 或 登录