Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=578c4aa0b455a1850208ccc67ca1ca23697e72f5
Commit:     578c4aa0b455a1850208ccc67ca1ca23697e72f5
Parent:     1d75981a8094e9f84fae65a6a83b361e3893b971
Author:     Ed L. Cashin <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:20:09 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:32 2008 -0800

    aoe: make error messages more specific
    
    Andrew Morton pointed out that the "too many targets" message in patch 2 
could
    be printed for failing GFP_ATOMIC allocations.  This patch makes the 
messages
    more specific.
    
    Signed-off-by: Ed L. Cashin <[EMAIL PROTECTED]>
    Cc: Greg KH <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 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 bcea36c..1e37cf6 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)
        for (; tt < te && *tt; tt++)
                ;
 
-       if (tt == te)
+       if (tt == te) {
+               printk(KERN_INFO
+                       "aoe: device addtgt failure; too many targets\n");
                return NULL;
-
+       }
        t = kcalloc(1, sizeof *t, GFP_ATOMIC);
-       if (!t)
-               return NULL;
        f = kcalloc(nframes, sizeof *f, GFP_ATOMIC);
-       if (!f) {
+       if (!t || !f) {
+               kfree(f);
                kfree(t);
+               printk(KERN_INFO "aoe: cannot allocate memory to add target\n");
                return NULL;
        }
 
@@ -1029,9 +1031,6 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
        if (!t) {
                t = addtgt(d, h->src, n);
                if (!t) {
-                       printk(KERN_INFO
-                               "aoe: device addtgt failure; "
-                               "too many targets?\n");
                        spin_unlock_irqrestore(&d->lock, flags);
                        return;
                }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to