[patch 21/45] USB: handle idVendor of 0x0000

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Thursday, February 7, 2008 - 1:47 pm

2.6.24-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Greg Kroah-Hartman <gregkh@suse.de>

Some crazy devices in the wild have a vendor id of 0x0000.  If we try to
add a module alias with this id, we just can't do it due to a check in
the file2alias.c file.  Change the test to verify that both the vendor
and product ids are 0x0000 to show a real "blank" module alias.

Note, the module-init-tools package also needs to be changed to properly
generate the depmod tables.

Cc: Janusz <janumix@poczta.fm>
Cc: Jon Masters <jcm@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/core/driver.c |    4 ++--
 scripts/mod/file2alias.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -534,8 +534,8 @@ const struct usb_device_id *usb_match_id
 	   id->driver_info is the way to create an entry that
 	   indicates that the driver want to examine every
 	   device and interface. */
-	for (; id->idVendor || id->bDeviceClass || id->bInterfaceClass ||
-	       id->driver_info; id++) {
+	for (; id->idVendor || id->idProduct || id->bDeviceClass ||
+	       id->bInterfaceClass || id->driver_info; id++) {
 		if (usb_match_one_id(interface, id))
 			return id;
 	}
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -155,7 +155,7 @@ static void do_usb_entry_multi(struct us
 	 * Some modules (visor) have empty slots as placeholder for
 	 * run-time specification that results in catch-all alias
 	 */
-	if (!(id->idVendor | id->bDeviceClass | id->bInterfaceClass))
+	if (!(id->idVendor | id->idProduct | id->bDeviceClass | id->bInterfaceClass))
 		return;
 
 	/* Convert numeric bcdDevice range into fnmatch-able pattern(s) */

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/45] 2.6.24-stable review, Greg KH, (Thu Feb 7, 1:45 pm)
[patch 04/45] USB: keyspan: Fix oops, Greg KH, (Thu Feb 7, 1:46 pm)
[patch 06/45] USB: CP2101 New Device IDs, Greg KH, (Thu Feb 7, 1:46 pm)
[patch 10/45] USB: sierra driver - add devices, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 17/45] USB: use GFP_NOIO in reset path, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 21/45] USB: handle idVendor of 0x0000, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 23/45] forcedeth: mac address mcp77/79, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 24/45] lockdep: annotate epoll, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 26/45] PCI: Fix fakephp deadlock, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 27/45] ACPI: update ACPI blacklist, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 31/45] b43: Fix suspend/resume, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 34/45] b43legacy: fix PIO crash, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 35/45] b43legacy: fix suspend/resume, Greg KH, (Thu Feb 7, 1:48 pm)
[patch 39/45] b43: Reject new firmware early, Greg KH, (Thu Feb 7, 1:48 pm)
Re: [patch 00/45] 2.6.24-stable review, S.Çağlar, (Thu Feb 7, 2:41 pm)
Re: [patch 00/45] 2.6.24-stable review, Greg KH, (Thu Feb 7, 2:58 pm)
Re: [patch 00/45] 2.6.24-stable review, Chuck Ebbert, (Thu Feb 7, 4:50 pm)
Re: [patch 00/45] 2.6.24-stable review, David Chinner, (Thu Feb 7, 5:44 pm)
Re: [stable] [patch 00/45] 2.6.24-stable review, David Chinner, (Thu Feb 7, 6:24 pm)
Re: [stable] [patch 00/45] 2.6.24-stable review, Greg KH, (Thu Feb 7, 10:31 pm)
Re: [patch 43/45] x86: replace LOCK_PREFIX in futex.h, Stefan Lippers-Hollmann, (Fri Feb 8, 11:35 am)
Re: [patch 43/45] x86: replace LOCK_PREFIX in futex.h, Chuck Ebbert, (Fri Feb 8, 2:45 pm)