]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
aoe: cleanup an allocation a bit
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 28 Sep 2012 00:22:22 +0000 (10:22 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 3 Oct 2012 06:51:03 +0000 (16:51 +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 15af2a1d1b3174f0283357c80f67ec621dcceed5..59b333c902a6485225a69c78ba3ef8417fa2b778 100644 (file)
@@ -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;
        }