diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index bca8c350e7f30e44ea4743adcd606234aa44627c..b6c8a6629b397134f5ea539adb7ef8ba80625225 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -1453,8 +1453,8 @@ static void netdev_release(struct device *d) static const void *net_namespace(struct device *d) { - struct net_device *dev; - dev = container_of(d, struct net_device, dev); + struct net_device *dev = to_net_dev(d); + return dev_net(dev); }