commit | f5727cd31283aa478f7f9396c6eb7b5aceebb869 | [log] [tgz] |
---|---|---|
author | Xiubo Li <Li.Xiubo@freescale.com> | Wed Apr 30 17:31:08 2014 +0800 |
committer | Mark Brown <broonie@linaro.org> | Wed Apr 30 20:33:57 2014 -0700 |
tree | db763dd8418489159f01bb5397d7895df81ca610 | |
parent | c9eaa447e77efe77b7fa4c953bd62de8297fd6c5 [diff] |
regmap: Fix possible ZERO_SIZE_PTR pointer dereferencing error. Since we cannot make sure the 'len = pair_size * num_regs' will always be none zero from the users, and then if 'num_regs' equals to zero by mistake or other reasons, the kzalloc() will return ZERO_SIZE_PTR, which equals to ((void *)16). So this patch fix this with just doing the 'len' zero check before calling kzalloc(). Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>