From: Xiubo Li Date: Wed, 30 Apr 2014 09:31:08 +0000 (+0800) Subject: regmap: Fix possible ZERO_SIZE_PTR pointer dereferencing error. X-Git-Tag: omap-for-v3.16/fixes-against-rc1~39^2~30^2~2^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5727cd31283aa478f7f9396c6eb7b5aceebb869;p=pandora-kernel.git 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 Signed-off-by: Mark Brown --- Reading git-diff-tree failed