Commit 41f00e6e authored by Aditya Pakki's avatar Aditya Pakki Committed by Greg Kroah-Hartman

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: default avatarAditya Pakki <pakki001@umn.edu>
Reviewed-by: default avatarRichard Leitner <richard.leitner@skidata.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e671765e
......@@ -612,7 +612,7 @@ static int usb251xb_probe(struct usb251xb *hub)
dev);
int err;
if (np) {
if (np && of_id) {
err = usb251xb_get_ofdata(hub,
(struct usb251xb_data *)of_id->data);
if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment