aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/sysfs/file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 602f56db0442..d2bb7ed8fa74 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -449,10 +449,12 @@ void sysfs_notify_dirent(struct sysfs_dirent *sd)
449 449
450 spin_lock_irqsave(&sysfs_open_dirent_lock, flags); 450 spin_lock_irqsave(&sysfs_open_dirent_lock, flags);
451 451
452 od = sd->s_attr.open; 452 if (!WARN_ON(sysfs_type(sd) != SYSFS_KOBJ_ATTR)) {
453 if (od) { 453 od = sd->s_attr.open;
454 atomic_inc(&od->event); 454 if (od) {
455 wake_up_interruptible(&od->poll); 455 atomic_inc(&od->event);
456 wake_up_interruptible(&od->poll);
457 }
456 } 458 }
457 459
458 spin_unlock_irqrestore(&sysfs_open_dirent_lock, flags); 460 spin_unlock_irqrestore(&sysfs_open_dirent_lock, flags);