ion: fix crash when alloc len is -1
authorColin Cross <ccross@android.com>
Wed, 13 Nov 2013 22:44:53 +0000 (14:44 -0800)
committerColin Cross <ccross@android.com>
Sat, 16 Nov 2013 00:10:14 +0000 (16:10 -0800)
commit49bdc418a3c1129d49fe92d89cf77111584fb51f
treeb35cd45a9ce97a6890e290d4a9c945c35c79e919
parent33a57aa073dac709bcdcba23bc4e2e7fcc6330f6
ion: fix crash when alloc len is -1

If userspace passes a length between -4095 and -1 to allocate it
will pass the len != 0 check, but when len is page aligned it will
be 0.  Check len after page aligning.

Drop the warning as well, userspace shouldn't be able to trigger
a warning in the kernel.

Change-Id: I96c7142637638991f3a9af9be7cfbb50f79f3803
Signed-off-by: Colin Cross <ccross@android.com>
drivers/staging/android/ion/ion.c