aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/driver.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 9b29e5c94be7..620a0baf103e 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -74,10 +74,13 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids,
const struct usb_device_id *id = id_table;
for (; id->match_flags; id++)
- if (id->idVendor == refVendor && id->idProduct == refProduct) {
- dynid->id.driver_info = id->driver_info;
+ if (id->idVendor == refVendor && id->idProduct == refProduct)
break;
- }
+
+ if (id->match_flags)
+ dynid->id.driver_info = id->driver_info;
+ else
+ return -ENODEV;
}
spin_lock(&dynids->lock);