mirror of
https://github.com/RustyRaptor/riscv-linux.git
synced 2026-12-06 09:55:30 -07:00
netpoll: prevent netpoll setup on slave devices
In commit 8d8fc29d02
(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 <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
1 parent
fe6fe792fa
commit
0c1ad04aec
1 file changed
+6
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user