aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2014-01-13 05:29:23 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-13 18:54:03 -0500
commit1b9fb31f7db7882d475bdc8b335403e8eaabf1ef (patch)
treebac2c09511d7807b5df8a7dca8951d04e8445e71 /drivers/usb
parentf563926fed982f26b391ca42493f55f2447f1b0a (diff)
usb: core: check for valid id_table when using the RefId feature
When implementing the RefId feature, it was missed that id_tables can be NULL under special circumstances. Bail out in that case. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/driver.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 620a0baf103e..5d01558cef66 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -73,6 +73,9 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids,
73 if (fields > 4) { 73 if (fields > 4) {
74 const struct usb_device_id *id = id_table; 74 const struct usb_device_id *id = id_table;
75 75
76 if (!id)
77 return -ENODEV;
78
76 for (; id->match_flags; id++) 79 for (; id->match_flags; id++)
77 if (id->idVendor == refVendor && id->idProduct == refProduct) 80 if (id->idVendor == refVendor && id->idProduct == refProduct)
78 break; 81 break;