lkml.org 
[lkml]   [2007]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 18] drivers/md/dm-table.c: kmalloc + memset conversion to kzalloc
Date
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>

drivers/md/dm-table.c | 21698 -> 21664 (-34 bytes)
drivers/md/dm-table.o | 132153 -> 132093 (-60 bytes)

drivers/md/dm-table.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

--- linux-2.6.23-rc1-mm1-a/drivers/md/dm-table.c 2007-07-26 13:07:41.000000000 +0200
+++ linux-2.6.23-rc1-mm1-b/drivers/md/dm-table.c 2007-07-31 13:19:43.000000000 +0200
@@ -213,12 +213,12 @@ static int alloc_targets(struct dm_table
int dm_table_create(struct dm_table **result, int mode,
unsigned num_targets, struct mapped_device *md)
{
- struct dm_table *t = kmalloc(sizeof(*t), GFP_KERNEL);
-
+ struct dm_table *t;
+
+ t = kzalloc(sizeof(*t), GFP_KERNEL);
if (!t)
return -ENOMEM;

- memset(t, 0, sizeof(*t));
INIT_LIST_HEAD(&t->devices);
atomic_set(&t->holders, 1);

@@ -229,7 +229,6 @@ int dm_table_create(struct dm_table **re

if (alloc_targets(t, num_targets)) {
kfree(t);
- t = NULL;
return -ENOMEM;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-07-31 19:29    [W:0.429 / U:1.472 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site