tun: Don't add sysfs attributes to devices without sysfs directories
authorBen Hutchings <ben@decadent.org.uk>
Thu, 9 Sep 2010 04:21:16 +0000 (05:21 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:17:50 +0000 (13:17 -0700)
commit11bb28b4168d940f156b9752e8d12ca403cb0426
tree824e8b1d7bf820cf9d2bdbb122d76c662a46a73b
parent88c0bb95c7e71d972f77ec4ea1be611b7e015066
tun: Don't add sysfs attributes to devices without sysfs directories

This applies to 2.6.32 *only*.  It has not been applied upstream since
the limitation no longer exists.

Prior to Linux 2.6.35, net devices outside the initial net namespace
did not have sysfs directories.  Attempting to add attributes to
them will trigger a BUG().

Reported-and-tested-by: Russell Stuart <russell-debian@stuart.id.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/tun.c