diff options
Diffstat (limited to 'drivers/block/aoe/aoecmd.c')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index bcea36c87d04..1e37cf6d9214 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -957,15 +957,17 @@ addtgt(struct aoedev *d, char *addr, ulong nframes) | |||
957 | for (; tt < te && *tt; tt++) | 957 | for (; tt < te && *tt; tt++) |
958 | ; | 958 | ; |
959 | 959 | ||
960 | if (tt == te) | 960 | if (tt == te) { |
961 | printk(KERN_INFO | ||
962 | "aoe: device addtgt failure; too many targets\n"); | ||
961 | return NULL; | 963 | return NULL; |
962 | 964 | } | |
963 | t = kcalloc(1, sizeof *t, GFP_ATOMIC); | 965 | t = kcalloc(1, sizeof *t, GFP_ATOMIC); |
964 | if (!t) | ||
965 | return NULL; | ||
966 | f = kcalloc(nframes, sizeof *f, GFP_ATOMIC); | 966 | f = kcalloc(nframes, sizeof *f, GFP_ATOMIC); |
967 | if (!f) { | 967 | if (!t || !f) { |
968 | kfree(f); | ||
968 | kfree(t); | 969 | kfree(t); |
970 | printk(KERN_INFO "aoe: cannot allocate memory to add target\n"); | ||
969 | return NULL; | 971 | return NULL; |
970 | } | 972 | } |
971 | 973 | ||
@@ -1029,9 +1031,6 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
1029 | if (!t) { | 1031 | if (!t) { |
1030 | t = addtgt(d, h->src, n); | 1032 | t = addtgt(d, h->src, n); |
1031 | if (!t) { | 1033 | if (!t) { |
1032 | printk(KERN_INFO | ||
1033 | "aoe: device addtgt failure; " | ||
1034 | "too many targets?\n"); | ||
1035 | spin_unlock_irqrestore(&d->lock, flags); | 1034 | spin_unlock_irqrestore(&d->lock, flags); |
1036 | return; | 1035 | return; |
1037 | } | 1036 | } |