Don't care about events if nobody listens.
authorAlexander Polakov <polachok@gmail.com>
Thu, 26 Nov 2009 23:00:37 +0000 (02:00 +0300)
committerAlexander Polakov <polachok@gmail.com>
Wed, 2 Dec 2009 21:47:35 +0000 (00:47 +0300)
Is that a good idea?

sys/dev/misc/hotplug/hotplug.c

index b52a641..1c789e1 100644 (file)
@@ -170,7 +170,7 @@ hotplug_devfs_node_added(cdev_t dev) {
        u_int class;
        char *name;
 
-       if(dev == NULL)
+       if(!dev || !hpsc.opened)
                return;
        class = dev->si_ops->head.flags;
        name = dev->si_name;
@@ -186,7 +186,7 @@ hotplug_devfs_node_removed(cdev_t dev) {
        u_int class;
        char *name;
 
-       if(dev == NULL)
+       if(!dev || !hpsc.opened)
                return;
        class = dev->si_ops->head.flags;
        name = dev->si_name;