aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-04-30 03:52:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:32 -0400
commit6a51830e14529063cb2685921e1177d9af50e49a (patch)
treed10f96946d36928e8b4cd021be67072321eb4943
parent7f1133cbf20bc308d73ba49f971180924e12119b (diff)
md: fix use after free when removing rdev via sysfs
rdev->mddev is no longer valid upon return from entry->store() when the 'remove' command is given. Cc: <stable@kernel.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/md/md.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index bb3e4b1cb773..11457a28a14c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2097,7 +2097,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
2097 rv = -EBUSY; 2097 rv = -EBUSY;
2098 else 2098 else
2099 rv = entry->store(rdev, page, length); 2099 rv = entry->store(rdev, page, length);
2100 mddev_unlock(rdev->mddev); 2100 mddev_unlock(mddev);
2101 } 2101 }
2102 return rv; 2102 return rv;
2103} 2103}