Procházet zdrojové kódy

dm-raid1.c: fix NULL dereferences

This patch fixes two NULL dereferences introduced by commit
06386bbfd2441416875d0403d405c56822f6ebac 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>
Adrian Bunk před 17 roky
rodič
revize
e03f1a8422
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 4 3
      drivers/md/dm-raid1.c

+ 4 - 3
drivers/md/dm-raid1.c

@@ -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);
 
 		/*