mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create
@ 2017-07-28  7:39 Keerthy
  2017-07-29 17:15 ` kbuild test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Keerthy @ 2017-07-28  7:39 UTC (permalink / raw)
  To: ssantosh, m-karicheri2
  Cc: t-kristo, linux-arm-kernel, linux-kernel, j-keerthy

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>
---
 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-29 17:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-28  7:39 [PATCH] soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create Keerthy
2017-07-29 17:15 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®