[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190318235605.11055-1-pakki001@umn.edu>
Date: Mon, 18 Mar 2019 18:56:05 -0500
From: Aditya Pakki <pakki001@....edu>
To: pakki001@....edu
Cc: kjlu@....edu, Richard Leitner <richard.leitner@...data.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] usb: usb251xb: fix to avoid potential NULL pointer dereference
of_match_device in usb251xb_probe can fail and returns a NULL pointer.
The patch avoids a potential NULL pointer dereference in this scenario.
Signed-off-by: Aditya Pakki <pakki001@....edu>
---
drivers/usb/misc/usb251xb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
index 4d72b7d1d383..fe5266dc8864 100644
--- a/drivers/usb/misc/usb251xb.c
+++ b/drivers/usb/misc/usb251xb.c
@@ -612,6 +612,8 @@ static int usb251xb_probe(struct usb251xb *hub)
dev);
int err;
+ if (!of_id)
+ return -ENODEV;
if (np) {
err = usb251xb_get_ofdata(hub,
(struct usb251xb_data *)of_id->data);
--
2.17.1
Powered by blists - more mailing lists