[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0204c749-986d-b419-73ca-23458916a31e@users.sourceforge.net>
Date: Thu, 29 Sep 2016 11:10:07 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: dm-devel@...hat.com, linux-raid@...r.kernel.org,
Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>, Shaohua Li <shli@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>,
Wolfram Sang <wsa@...-dreams.de>
Subject: [PATCH 02/10] dm snapshot: Delete two error messages for a failed
memory allocation
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 28 Sep 2016 22:33:09 +0200
Omit extra messages for a memory allocation failure in this function.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/md/dm-snap.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index f262f7e..7d81390 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -329,10 +329,8 @@ static int init_origin_hash(void)
_origins = kmalloc_array(ORIGIN_HASH_SIZE,
sizeof(*_origins),
GFP_KERNEL);
- if (!_origins) {
- DMERR("unable to allocate memory for _origins");
+ if (!_origins)
return -ENOMEM;
- }
for (i = 0; i < ORIGIN_HASH_SIZE; i++)
INIT_LIST_HEAD(_origins + i);
@@ -340,7 +338,6 @@ static int init_origin_hash(void)
sizeof(*_dm_origins),
GFP_KERNEL);
if (!_dm_origins) {
- DMERR("unable to allocate memory for _dm_origins");
kfree(_origins);
return -ENOMEM;
}
--
2.10.0
Powered by blists - more mailing lists