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. Change-Id: I3d2894d4f68c9a8e802304d3211f9670294d00c0 Acked-by:Colin Cross <ccross@android.com> Cc: Android Kernel Team <kernel-team@android.com> Reported-by:
kbuild test robot <fengguang.wu@intel.com> Signed-off-by:
John Stultz <john.stultz@linaro.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Git-commit: 60e11dfc002962181fe4f0db54b33c65fee02c52 Git-repo: http://android.googlesource.com/kernel/common/ [mitchelh@codeaurora.org: some context differences since we were already checking for a NULL return value] Signed-off-by:
Mitchel Humpherys <mitchelh@codeaurora.org>
Loading
Please register or sign in to comment