6lowpan: fix debugfs interface entry name
authorAlexander Aring <alex.aring@gmail.com>
Tue, 15 Dec 2015 11:25:35 +0000 (12:25 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 20 Dec 2015 07:21:00 +0000 (08:21 +0100)
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@nordicsemi.no>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Acked-by: Lukasz Duda <lukasz.duda@nordicsemi.no>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/6lowpan/core.c

index c7f06f5c01213d280f57106c37d066be956a3942..faf65baed617d5c5b39d9cadd5ef0264ea546d59 100644 (file)
@@ -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;
 }