Thread (4 messages) 4 messages, 3 authors, 2008-06-28

Re: [Patch] net/sched/sch_generic.c: fix an error pointer

From: WANG Cong <hidden>
Date: 2008-06-21 19:58:16
Also in: lkml
Subsystem: networking [general], tc subsystem, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jamal Hadi Salim, Jiri Pirko, Linus Torvalds

On Thu, Jun 19, 2008 at 04:11:08PM -0700, David Miller wrote:
From: WANG Cong <redacted>
Date: Thu, 19 Jun 2008 15:37:14 +0100
quoted
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 <redacted>
Patch is whitespace corruped and line wrapped by your
email client.

Please fix this and resubmit, thank you.
I am very sorry for this. Resend it with mutt. :-)

--------------->

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 <redacted>
Cc: David Miller <davem@davemloft.net>
Cc:  Alexey Kuznetsov <redacted>

---
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,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help