Skip to contentSkip to conversation

netpoll: prevent netpoll setup on slave devices

PATCH Applied Amerigo Wang 2 participants 2 messages Jun 9, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

net/core/netpoll.c +6 -0
index 2d7d6d4..42ea4b0 100644
@@ -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;
 
maintainer Applied
#1 lore raw

From: Amerigo Wang <[email protected]>
Date: Thu, 9 Jun 2011 10:42:40 +0800

Quoted 7 lines

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.

Applied, thanks.