Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 60e11dfc authored by John Stultz's avatar John Stultz Committed by Colin Cross
Browse files

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: default avatarColin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d232ba2b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment