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 <w...@the-dreams.de>
---
 drivers/usb/core/driver.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 024dbfd..3f248b6 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,
        if (fields > 4) {
                const struct usb_device_id *id = id_table;
 
+               if (!id)
+                       return -ENODEV;
+
                for (; id->match_flags; id++)
                        if (id->idVendor == refVendor && id->idProduct == 
refProduct)
                                break;
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to