From: John Stultz Date: Tue, 17 Dec 2013 05:07:52 +0000 (-0800) Subject: staging: ion: Fix possible null pointer dereference X-Git-Tag: v3.14-rc1~150^2~354 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4ea823be2ca9e61522de002804c9a7a54c9be16;p=pandora-kernel.git staging: ion: Fix possible null pointer dereference The kbuild test robot reported: drivers/staging/android/ion/ion_system_heap.c:122 alloc_largest_available() error: potential null dereference 'info'. (kmalloc returns null) Where the pointer returned from kmalloc goes unchecked for failure. This patch checks the return for NULL, and reworks the logic, as suggested by Colin, so we allocate the page_info structure first. Acked-by: Colin Cross Cc: Android Kernel Team Reported-by: kbuild test robot Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed