From: Xiubo Li
Date: Wed, 24 Sep 2014 06:30:29 +0000 (+0800)
Subject: spi: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
X-Git-Tag: fixes-for-v3.18-merge-window~30^2~6^2
X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7908a37aeee2a038d7b1492eae29750d8738d2e;p=pandora-kernel.git
spi: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
Since we cannot make sure the 'n' 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: Mark Brown
---
Reading git-diff-tree failed