diff options
author | Aditya Pakki <pakki001@umn.edu> | 2019-03-20 10:27:11 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-26 16:48:55 +0900 |
commit | 41f00e6e9e55546390031996b773e7f3c1d95928 (patch) | |
tree | 7f73df8ce07550130c144d8c314e9fe3642c1e67 /drivers/usb/misc | |
parent | e671765e521c571afec3157a7e17502d54f6a43e (diff) | |
download | blackbird-op-linux-41f00e6e9e55546390031996b773e7f3c1d95928.tar.gz blackbird-op-linux-41f00e6e9e55546390031996b773e7f3c1d95928.zip |
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>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r-- | drivers/usb/misc/usb251xb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 2c8e2cad7e10..04684849d683 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -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) { |