Fix a potential NULL dereference in md/raid1
commitfbb8b6ef114c7c298a6e20bf271c7b16978d0a70
authorNeil Brown <neilb@suse.de>
Sat, 26 Aug 2006 15:33:27 +0000 (26 17:33 +0200)
committerAdrian Bunk <bunk@stusta.de>
Sat, 26 Aug 2006 15:33:27 +0000 (26 17:33 +0200)
treef0eb3af0fe81a3c9f9aa20c676a460523e9276cb
parent13967acced1d331cb76a3392e53d3a72dfcbbd64
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: Adrian Bunk <bunk@stusta.de>
drivers/md/raid1.c