]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
aoe: cleanup an allocation a bit
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 13 Sep 2012 01:01:33 +0000 (11:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 17 Sep 2012 10:46:22 +0000 (20:46 +1000)
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 <dan.carpenter@oracle.com>
Cc: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/aoe/aoecmd.c

index da66a6a6a8fe2a05c79c2f91def1f430466c116f..ed4d3bf095c80f8bd83701e476bdbfc7efb34d53 100644 (file)
@@ -1156,9 +1156,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;
        }