[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <358ed815-9f68-6c48-0eee-0045e40fa96d@users.sourceforge.net>
Date: Tue, 27 Sep 2016 18:53:20 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-raid@...r.kernel.org, Shaohua Li <shli@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 06/16] md/bitmap: Return directly after a failed kzalloc() in
bitmap_resize()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 27 Sep 2016 15:21:23 +0200
* Return directly after a call of the function "kzalloc" failed here.
* Delete two assignments for the local variable "ret" and the jump
target "err" which became unnecessary with this refactoring.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/md/bitmap.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 5092bc0..2d30c83 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -2037,10 +2037,9 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
pages = DIV_ROUND_UP(chunks, PAGE_COUNTER_RATIO);
new_bp = kzalloc(pages * sizeof(*new_bp), GFP_KERNEL);
- ret = -ENOMEM;
if (!new_bp) {
bitmap_file_unmap(&store);
- goto err;
+ return -ENOMEM;
}
if (!init)
@@ -2160,8 +2159,6 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
bitmap_unplug(bitmap);
bitmap->mddev->pers->quiesce(bitmap->mddev, 0);
}
- ret = 0;
-err:
return ret;
}
EXPORT_SYMBOL_GPL(bitmap_resize);
--
2.10.0
Powered by blists - more mailing lists