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

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

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);