netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bluetooth-next] 6lowpan: fix debugfs interface entry name
@ 2015-12-15 11:25 Alexander Aring
  2015-12-15 11:47 ` Duda, Lukasz
  2015-12-20  7:22 ` Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Aring @ 2015-12-15 11:25 UTC (permalink / raw)
  To: linux-wpan-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	lukasz.duda-hR+23Fw+YnFSHonuZl5R5Q, Alexander Aring

This patches moves the debugfs interface related register after
netdevice register. The function lowpan_dev_debugfs_init will use
"dev->name" which can be before register_netdevice a format string.
The function register_netdevice will evaluate the format string if
necessary and replace "dev->name" to the real interface name.

Reported-by: Lukasz Duda <lukasz.duda-hR+23Fw+YnFSHonuZl5R5Q@public.gmane.org>
Signed-off-by: Alexander Aring <alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 net/6lowpan/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
index c7f06f5..faf65ba 100644
--- a/net/6lowpan/core.c
+++ b/net/6lowpan/core.c
@@ -29,13 +29,13 @@ int lowpan_register_netdevice(struct net_device *dev,
 
 	lowpan_priv(dev)->lltype = lltype;
 
-	ret = lowpan_dev_debugfs_init(dev);
+	ret = register_netdevice(dev);
 	if (ret < 0)
 		return ret;
 
-	ret = register_netdevice(dev);
+	ret = lowpan_dev_debugfs_init(dev);
 	if (ret < 0)
-		lowpan_dev_debugfs_exit(dev);
+		unregister_netdevice(dev);
 
 	return ret;
 }
-- 
2.6.1

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

end of thread, other threads:[~2015-12-20  7:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-15 11:25 [PATCH bluetooth-next] 6lowpan: fix debugfs interface entry name Alexander Aring
2015-12-15 11:47 ` Duda, Lukasz
2015-12-20  7:22 ` Marcel Holtmann

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