summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/usb251xb.c
diff options
context:
space:
mode:
authorAditya Pakki <pakki001@umn.edu>2019-03-20 18:27:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-04 10:20:20 +0300
commit0018c21f34d666c2755460123d9f37a02dc8ce60 (patch)
treef2cfcd2a0b672d95f6a293d55e04f3c40b19a0d4 /drivers/usb/misc/usb251xb.c
parent4135e588274e7b8ddeea95683f9d70f19d019f2e (diff)
downloadlinux-0018c21f34d666c2755460123d9f37a02dc8ce60.tar.xz
usb: usb251xb: fix to avoid potential NULL pointer dereference
[ Upstream commit 41f00e6e9e55546390031996b773e7f3c1d95928 ] 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> Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
Diffstat (limited to 'drivers/usb/misc/usb251xb.c')
-rw-r--r--drivers/usb/misc/usb251xb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
index a6efb9a72939..5f7734c729b1 100644
--- a/drivers/usb/misc/usb251xb.c
+++ b/drivers/usb/misc/usb251xb.c
@@ -601,7 +601,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) {