chiark / gitweb /
[PATCH] skip waiting for device if we get a bad event for class creation
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Sat, 23 Oct 2004 10:15:22 +0000 (12:15 +0200)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 05:06:44 +0000 (22:06 -0700)
wait_for_sysfs.c

index e7eed44..91a2b6b 100644 (file)
@@ -99,6 +99,12 @@ int main(int argc, char *argv[], char *envp[])
                snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_mnt_path, devpath);
                filename[SYSFS_PATH_MAX-1] = '\0';
 
+               /* skip bad events where we get no device for the class */
+               if (strncmp(devpath, "/class/", 7) == 0 && strchr(&devpath[7], '/') == NULL) {
+                       dbg("no device name for '%s', bad event", devpath);
+                       goto exit;
+               }
+
                /* open the class device we are called for */
                class_dev = open_class_device_wait(filename);
                if (!class_dev) {