Commit 4459398b authored by Keerthy's avatar Keerthy Committed by Arnd Bergmann

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: default avatarKeerthy <j-keerthy@ti.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 4dd6a997
...@@ -745,6 +745,9 @@ void *knav_pool_create(const char *name, ...@@ -745,6 +745,9 @@ void *knav_pool_create(const char *name,
bool slot_found; bool slot_found;
int ret; int ret;
if (!kdev)
return ERR_PTR(-EPROBE_DEFER);
if (!kdev->dev) if (!kdev->dev)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment