From: Wolfram Sang Date: Mon, 13 Jan 2014 10:29:23 +0000 (+0100) Subject: usb: core: check for valid id_table when using the RefId feature X-Git-Tag: v3.14-rc1~148^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b9fb31f7db7882d475bdc8b335403e8eaabf1ef;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 620a0ba..5d01558 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;