netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: WANG Cong <wcong@critical-links.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Netdev <netdev@vger.kernel.org>,
	David Miller <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Subject: [Patch] net/sched/sch_generic.c: fix an error pointer
Date: Thu, 19 Jun 2008 15:37:14 +0100	[thread overview]
Message-ID: <20080619153714.5614d5be@hack> (raw)


ERR_PTR() ususally encodes an negative errno, not positive.

Note, in the following patch, 'err' is initialized as:

int err = -ENOBUFS;

Signed-off-by: WANG Cong <wcong@critical-links.com>
Cc: David Miller <davem@davemloft.net>
Cc:  Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>

---
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index d355e5e..13afa72 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -468,7 +468,7 @@ struct Qdisc *qdisc_alloc(struct net_device *dev,
struct Qdisc_ops *ops) 
 	return sch;
 errout:
-	return ERR_PTR(-err);
+	return ERR_PTR(err);
 }
 
 struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct
Qdisc_ops *ops,

             reply	other threads:[~2008-06-19 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 14:37 WANG Cong [this message]
2008-06-19 23:11 ` [Patch] net/sched/sch_generic.c: fix an error pointer David Miller
2008-06-21 19:55   ` WANG Cong
2008-06-28  2:51     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080619153714.5614d5be@hack \
    --to=wcong@critical-links.com \
    --cc=davem@davemloft.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).