Skip to content

Commit

Permalink
dm-raid1.c: fix NULL dereferences
Browse files Browse the repository at this point in the history
This patch fixes two NULL dereferences introduced by commit
06386bb and spotted by the Coverity
checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Feb 19, 2008
1 parent ae5e1b6 commit e03f1a8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1695,14 +1695,15 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
* information for a retry or there was no other
* mirror in-sync.
*/
DMERR_LIMIT("Mirror read failed from %s.",
m->dev->name);
DMERR_LIMIT("Mirror read failed.");
return -EIO;
}

m = read_record->m;

DMERR("Mirror read failed from %s. Trying alternative device.",
m->dev->name);

m = read_record->m;
fail_mirror(m, DM_RAID1_READ_ERROR);

/*
Expand Down

0 comments on commit e03f1a8

Please sign in to comment.