]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
aoe: cleanup an allocation a bit
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 26 Sep 2012 01:35:00 +0000 (11:35 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 26 Sep 2012 05:45:40 +0000 (15:45 +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;
        }