From: Xiubo Li
Date: Mon, 18 Aug 2014 09:08:44 +0000 (+0800)
Subject: pwm: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
X-Git-Tag: fixes-against-v3.18-rc2~24^2~7
X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=533acc0e8df7d6553f11cf91c177211cb6037968;p=pandora-kernel.git
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
Signed-off-by: Thierry Reding
---
Reading git-diff-tree failed