commit | 533acc0e8df7d6553f11cf91c177211cb6037968 | [log] [tgz] |
---|---|---|
author | Xiubo Li <Li.Xiubo@freescale.com> | Mon Aug 18 17:08:44 2014 +0800 |
committer | Thierry Reding <thierry.reding@gmail.com> | Mon Aug 25 14:38:12 2014 +0200 |
tree | 812cd4e995141cfe2c1ce2533f52f4017d5af6b1 | |
parent | ad16202de8d884c10ef7637ea3982953519c2418 [diff] |
pwm: Fix possible ZERO_SIZE_PTR pointer dereferencing error. Since we cannot make sure the 'chip->npwm' will always be none zero here, and then if either equal to zero, the kzalloc() will return ZERO_SIZE_PTR, which equals to ((void *)16). So this patch fix this with just doing the zero check before calling kzalloc(). Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>