mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create
knav_pool_create is an exported function. In the event of a call before knav_queue_probe, we encounter a NULL pointer dereference in the following line. Hence return -EPROBE_DEFER to the caller till the kdev pointer is non-NULL. Signed-off-by: Keerthy <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
This commit is contained in:
parent
4dd6a9973b
commit
4459398b6d
1 changed files with 3 additions and 0 deletions
|
|
@ -745,6 +745,9 @@ void *knav_pool_create(const char *name,
|
|||
bool slot_found;
|
||||
int ret;
|
||||
|
||||
if (!kdev)
|
||||
return ERR_PTR(-EPROBE_DEFER);
|
||||
|
||||
if (!kdev->dev)
|
||||
return ERR_PTR(-ENODEV);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue