]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
MD: Fix a potential NULL dereference in md/raid1
authorNeilBrown <neilb@suse.de>
Mon, 21 Aug 2006 00:05:26 +0000 (10:05 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Aug 2006 21:13:32 +0000 (14:13 -0700)
commitdc41bfe271fee237ae41e3cbd8b4789b60da3e53
tree59762b9a87651d0495a27d7d2ce39035bd6bb40f
parent49071b9f45d2483dbde395fd6aa11f53974e7665
MD: Fix a potential NULL dereference in md/raid1

At the point where this 'atomic_add' is, rdev could be NULL, as seen by
the fact that we test for this in the very next statement.

Further is it is really the wrong place of the add.  We could add to the
count of corrected errors once the are sure it was corrected, not before
trying to correct it.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff .prev/drivers/md/raid1.c ./drivers/md/raid1.c
drivers/md/raid1.c