From: Mariusz Kozlowski drivers/md/dm-table.c | 21698 -> 21664 (-34 bytes) drivers/md/dm-table.o | 132153 -> 132093 (-60 bytes) Signed-off-by: Mariusz Kozlowski Cc: Alasdair G Kergon Signed-off-by: Andrew Morton --- drivers/md/dm-table.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff -puN drivers/md/dm-table.c~drivers-md-dm-tablec-kmalloc-memset-conversion-to-kzalloc drivers/md/dm-table.c --- a/drivers/md/dm-table.c~drivers-md-dm-tablec-kmalloc-memset-conversion-to-kzalloc +++ a/drivers/md/dm-table.c @@ -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; } _