From: Adrian Bunk Date: Tue, 19 Feb 2008 19:44:19 +0000 (+0000) Subject: dm-raid1.c: fix NULL dereferences X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e03f1a842287480aa03732612148c0d333baca61;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Alasdair G Kergon Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 2928ef228101..51605870f898 100644 --- a/drivers/md/dm-raid1.c +++ b/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); /*