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

Skip to content
Commit 14d80bb8 authored by John Stultz's avatar John Stultz Committed by Ian Maund
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.

Change-Id: I3d2894d4f68c9a8e802304d3211f9670294d00c0
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>
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: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent 34b3ee4a
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