Netdev List
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/2] bridge: do sysfs registration inside rtnl
Date: Wed, 10 May 2006 10:14:54 -0700	[thread overview]
Message-ID: <20060510171623.897951000@localhost.localdomain> (raw)
In-Reply-To: 20060510171452.619146000@localhost.localdomain

[-- Attachment #1: bridge-register.patch --]
[-- Type: text/plain, Size: 896 bytes --]

Now that netdevice sysfs registration is done as part of register_netdevice;
bridge code no longer has to be tricky when adding it's kobjects to bridges.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


--- bridge.orig/net/bridge/br_if.c	2006-05-04 16:22:29.000000000 -0700
+++ bridge/net/bridge/br_if.c	2006-05-09 11:27:16.000000000 -0700
@@ -308,26 +308,19 @@
 	if (ret)
 		goto err2;
 
-	/* network device kobject is not setup until
-	 * after rtnl_unlock does it's hotplug magic.
-	 * so hold reference to avoid race.
-	 */
-	dev_hold(dev);
-	rtnl_unlock();
-
 	ret = br_sysfs_addbr(dev);
-	dev_put(dev);
-
-	if (ret) 
-		unregister_netdev(dev);
- out:
-	return ret;
+	if (ret)
+		goto err3;
+	rtnl_unlock();
+	return 0;
 
+ err3:
+	unregister_netdev(dev);
  err2:
 	free_netdev(dev);
  err1:
 	rtnl_unlock();
-	goto out;
+	return ret;
 }
 
 int br_del_bridge(const char *name)

--


  parent reply	other threads:[~2006-05-10 17:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-10 17:14 [PATCH 0/2] register_netdevice and sysfs changes Stephen Hemminger
2006-05-10 17:14 ` [PATCH 1/2] netdev: do sysfs registration as part of register_netdevice Stephen Hemminger
2006-05-10 17:14 ` Stephen Hemminger [this message]
2006-05-10 20:19 ` [PATCH 0/2] register_netdevice and sysfs changes David S. 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=20060510171623.897951000@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=davem@davemloft.net \
    --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