提交 52a6966c 编写于 作者: W Wolfram Sang 提交者: Greg Kroah-Hartman

usb: core: bail out if user gives an unknown RefId when using new_id

If users use the new RefId feature of new_id, give them an error message
if they provided an unknown reference. That helps detecting typos.
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2fc82c2d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册