From 4e2029ae3580afe49e9cc378ff63e93617a4ca41 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Thu, 25 Oct 2012 10:11:18 +1100 Subject: [PATCH] mempool_alloc can't fail if __GFP_WAIT is specified, so the condition that tests if read_record is non-NULL is always true. Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon --- drivers/md/dm-raid1.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index fd61f98ee1f6..b37467618b16 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -1195,11 +1195,9 @@ static int mirror_map(struct dm_target *ti, struct bio *bio, return -EIO; read_record = mempool_alloc(ms->read_record_pool, GFP_NOIO); - if (likely(read_record)) { - dm_bio_record(&read_record->details, bio); - map_context->ptr = read_record; - read_record->m = m; - } + dm_bio_record(&read_record->details, bio); + map_context->ptr = read_record; + read_record->m = m; map_bio(m, bio); -- 2.39.5