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@umn.edu>
Reviewed-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Aditya Pakki 2019-03-20 10:27:11 -05:00 committed by Greg Kroah-Hartman
parent e671765e52
commit 41f00e6e9e
1 changed files with 1 additions and 1 deletions

View File

@ -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) {