linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][2.6.0-test9] prevent catch-all USB aliases in modules.alias
@ 2003-11-03 16:45 Andrey Borzenkov
  0 siblings, 0 replies; only message in thread
From: Andrey Borzenkov @ 2003-11-03 16:45 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

visor.c defines one empty slot in USB ids table that can be filled in at 
runtime using module parameters. file2alias generates catch-all alias for it:

alias usb:v*p*dl*dh*dc*dsc*dp*ic*isc*ip* visor

patch adds the same sanity check as in depmod to scripts/file2alias.

regards

-andrey

[-- Attachment #2: 2.6.0-test9-file2alias_visor.patch --]
[-- Type: text/x-diff, Size: 647 bytes --]

--- ../tmp/linux-2.6.0-test9/scripts/file2alias.c	2003-07-27 22:29:49.000000000 +0400
+++ linux-2.6.0-test9/scripts/file2alias.c	2003-11-03 19:40:47.744746456 +0300
@@ -52,6 +52,13 @@ static int do_usb_entry(const char *file
 	id->bcdDevice_lo = TO_NATIVE(id->bcdDevice_lo);
 	id->bcdDevice_hi = TO_NATIVE(id->bcdDevice_hi);
 
+	/*
+	 * 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))
+		return 1;
+
 	strcpy(alias, "usb:");
 	ADD(alias, "v", id->match_flags&USB_DEVICE_ID_MATCH_VENDOR,
 	    id->idVendor);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-03 16:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-03 16:45 [PATCH][2.6.0-test9] prevent catch-all USB aliases in modules.alias Andrey Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).