lkml.org 
[lkml]   [2016]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 02/10] dm snapshot: Delete two error messages for a failed memory allocation
From
Date
From: Markus Elfring <elfring@users.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@users.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
\
 
 \ /
  Last update: 2016-09-29 11:11    [W:0.523 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site