From: Rémi Denis-Courmont Date: Mon, 25 Oct 2010 07:43:32 +0000 (+0300) Subject: Phonet: device notifier only runs on initial namespace X-Git-Tag: v2.6.32.40~14 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c33790ec1212ef7a3f302c3e410cba6e0affe489;p=karo-tx-linux.git Phonet: device notifier only runs on initial namespace [bwh: This is only applicable to 2.6.32. Phonet was fixed upstream to work with multiple net namespaces.] This should really fix the OOPS when doing: unshare(CLONE_NEWNET); exit(0); while the phonet module is loaded. Signed-off-by: Rémi Denis-Courmont Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 5a2275c4ee79..d94ca91334d3 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -225,6 +225,9 @@ static int phonet_device_notify(struct notifier_block *me, unsigned long what, { struct net_device *dev = arg; + if (!net_eq(dev_net(dev), &init_net)) + return 0; + switch (what) { case NETDEV_REGISTER: if (dev->type == ARPHRD_PHONET)