Skip to content

Commit

Permalink
soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create
Browse files Browse the repository at this point in the history
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 <j-keerthy@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Keerthy authored and Arnd Bergmann committed Aug 21, 2017
1 parent 4dd6a99 commit 4459398
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/soc/ti/knav_qmss_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4459398

Please sign in to comment.