From: Jonathan Brassow Date: Thu, 13 Jan 2011 22:14:33 +0000 (+1100) Subject: md/raid5: use sysfs_notify_dirent_safe to avoid NULL pointer X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=43c73ca43b3e03bb228ff9350b6b44d0e560f262;p=linux-beck.git 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 Signed-off-by: Mike Snitzer --- 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);