From: WANG Cong Date: Thu, 9 Jun 2011 07:28:13 +0000 (-0700) Subject: netpoll: prevent netpoll setup on slave devices X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c1ad04aecb975f2a2014e1bc5a2fa23923ecbd9;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git netpoll: prevent netpoll setup on slave devices In commit 8d8fc29d02a33e4bd5f4fa47823c1fd386346093 (netpoll: disable netpoll when enslave a device), we automatically disable netpoll when the underlying device is being enslaved, we also need to prevent people from setuping netpoll on devices that are already enslaved. Signed-off-by: WANG Cong Signed-off-by: David S. Miller --- diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 2d7d6d473781..42ea4b0e59f1 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -792,6 +792,12 @@ int netpoll_setup(struct netpoll *np) return -ENODEV; } + if (ndev->master) { + printk(KERN_ERR "%s: %s is a slave device, aborting.\n", + np->name, np->dev_name); + return -EBUSY; + } + if (!netif_running(ndev)) { unsigned long atmost, atleast;