From eb5af405aacd3eab4b69f1f06b5fbe17f2902e03 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 28 Sep 2012 10:22:22 +1000 Subject: [PATCH] aoe: cleanup an allocation a bit We changed this recently so we can just use kzalloc() here instead of kcalloc(1, ...). Kernel style prefers sizeof(*t) over sizeof *t. The kfree(t) is a no-op now as well so that can be removed. Signed-off-by: Dan Carpenter Cc: Ed Cashin Signed-off-by: Andrew Morton --- drivers/block/aoe/aoecmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 15af2a1d1b31..59b333c902a6 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1157,9 +1157,8 @@ addtgt(struct aoedev *d, char *addr, ulong nframes) "aoe: device addtgt failure; too many targets\n"); return NULL; } - t = kcalloc(1, sizeof *t, GFP_ATOMIC); + t = kzalloc(sizeof(*t), GFP_ATOMIC); if (!t) { - kfree(t); printk(KERN_INFO "aoe: cannot allocate memory to add target\n"); return NULL; } -- 2.39.5