summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2011-01-13 23:14:33 +0100
committerNeilBrown <neilb@suse.de>2011-01-13 23:14:33 +0100
commit43c73ca43b3e03bb228ff9350b6b44d0e560f262 (patch)
tree2a6fcff1e62c53ba0a95295cf02ae785b1efb501 /drivers
parentmd: Ensure no IO request to get md device before it is properly initialised. (diff)
downloadlinux-43c73ca43b3e03bb228ff9350b6b44d0e560f262.tar.xz
linux-43c73ca43b3e03bb228ff9350b6b44d0e560f262.zip
md/raid5: use sysfs_notify_dirent_safe to avoid NULL pointer
With the module parameter 'start_dirty_degraded' set, raid5_spare_active() previously called sysfs_notify_dirent() with a NULL argument (rdev->sysfs_state) when a rebuild finished. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/raid5.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 316fbe79389a..9212c077095c 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5338,7 +5338,7 @@ static int raid5_spare_active(mddev_t *mddev)
&& !test_bit(Faulty, &tmp->rdev->flags)
&& !test_and_set_bit(In_sync, &tmp->rdev->flags)) {
count++;
- sysfs_notify_dirent(tmp->rdev->sysfs_state);
+ sysfs_notify_dirent_safe(tmp->rdev->sysfs_state);
}
}
spin_lock_irqsave(&conf->device_lock, flags);