[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1501227556-21087-1-git-send-email-j-keerthy@ti.com>
Date: Fri, 28 Jul 2017 13:09:16 +0530
From: Keerthy <j-keerthy@...com>
To: <ssantosh@...nel.org>, <m-karicheri2@...com>
CC: <t-kristo@...com>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <j-keerthy@...com>
Subject: [PATCH] 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 <j-keerthy@...com>
---
drivers/soc/ti/knav_qmss_queue.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 279e7c5..d91626b 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -745,6 +745,9 @@ void *knav_pool_create(const char *name,
bool slot_found;
int ret;
+ if (!kdev)
+ return -EPROBE_DEFER;
+
if (!kdev->dev)
return ERR_PTR(-ENODEV);
--
1.9.1
Powered by blists - more mailing lists