提交 1b9fb31f 编写于 作者: W Wolfram Sang 提交者: Greg Kroah-Hartman

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: NWolfram Sang <wsa@the-dreams.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f563926f
...@@ -73,6 +73,9 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids, ...@@ -73,6 +73,9 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids,
if (fields > 4) { if (fields > 4) {
const struct usb_device_id *id = id_table; const struct usb_device_id *id = id_table;
if (!id)
return -ENODEV;
for (; id->match_flags; id++) for (; id->match_flags; id++)
if (id->idVendor == refVendor && id->idProduct == refProduct) if (id->idVendor == refVendor && id->idProduct == refProduct)
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册