From: Xiubo Li Date: Mon, 19 May 2014 07:13:45 +0000 (+0800) Subject: regmap: irq: Fix possible ZERO_SIZE_PTR pointer dereferencing error. X-Git-Tag: omap-for-v3.16/fixes-against-rc1~39^2~30^2~1^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e12892070184ee782c207f09722a93d0236be955;p=pandora-kernel.git regmap: irq: Fix possible ZERO_SIZE_PTR pointer dereferencing error. Since we cannot make sure the 'chip->num_regs' will always be none zero from the users, and then if 'chip->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 checking the 'chip->num_regs' before calling kzalloc(). This also sorts the header files in alphabetical order at the same time. Signed-off-by: Xiubo Li Signed-off-by: Mark Brown --- Reading git-diff-tree failed