regmap: irq: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
authorXiubo Li <Li.Xiubo@freescale.com>
Mon, 19 May 2014 07:13:45 +0000 (15:13 +0800)
committerMark Brown <broonie@linaro.org>
Mon, 26 May 2014 15:37:04 +0000 (16:37 +0100)
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 <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/base/regmap/regmap-irq.c

Simple merge