summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-10-23 12:15:22 +0200
committerGreg KH <gregkh@suse.de>2005-04-26 22:06:44 -0700
commitab51035617d5725305b8ef98eff6b7c64f3ccec6 (patch)
tree1194cfa5d566b5e954790237cf21c7084b4aa715
parent21d2888a0a0d238594e4124fe8020f54bfa29df5 (diff)
[PATCH] skip waiting for device if we get a bad event for class creation
-rw-r--r--wait_for_sysfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wait_for_sysfs.c b/wait_for_sysfs.c
index e7eed441ee..91a2b6b628 100644
--- a/wait_for_sysfs.c
+++ b/wait_for_sysfs.c
@@ -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) {