netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][DECNET] dn_nl_deladdr() almost always returns no error
@ 2007-11-29 16:29 Pavel Emelyanov
  2007-11-29 16:35 ` Steven Whitehouse
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Emelyanov @ 2007-11-29 16:29 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Patrick Caulfield, Linux Netdev List, devel, linux-decnet-user

As far as I see from the err variable initialization
the dn_nl_deladdr() routine was designed to report errors
like "EADDRNOTAVAIL" and probaby "ENODEV".

But the code sets this err to 0 after the first nlmsg_parse
and goes on, returning this 0 in any case.

Is this made deliberately, or the patch below is correct?

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 66e266f..3bc82dc 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -651,16 +651,18 @@ static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 	struct dn_dev *dn_db;
 	struct ifaddrmsg *ifm;
 	struct dn_ifaddr *ifa, **ifap;
-	int err = -EADDRNOTAVAIL;
+	int err;
 
 	err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy);
 	if (err < 0)
 		goto errout;
 
+	err = -ENODEV;
 	ifm = nlmsg_data(nlh);
 	if ((dn_db = dn_dev_by_index(ifm->ifa_index)) == NULL)
 		goto errout;
 
+	err = -EADDRNOTAVAIL;
 	for (ifap = &dn_db->ifa_list; (ifa = *ifap); ifap = &ifa->ifa_next) {
 		if (tb[IFA_LOCAL] &&
 		    nla_memcmp(tb[IFA_LOCAL], &ifa->ifa_local, 2))

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-30 12:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-29 16:29 [PATCH][DECNET] dn_nl_deladdr() almost always returns no error Pavel Emelyanov
2007-11-29 16:35 ` Steven Whitehouse
2007-11-30 12:44   ` Herbert Xu

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).