Subject: [PATCH 09/11] netpoll: ethernet devices only

From: Stephen Hemminger <[email-masked]>
Date: Sat, 03 Nov 2007 11:43:23 -0700

Netpoll only works on Ethernet devices, so check during setup
rather than just failing silently later.

Signed-off-by: Stephen Hemminger <[email-masked]>

--- a/net/core/netpoll.c	2007-11-03 11:05:33.000000000 -0700
+++ b/net/core/netpoll.c	2007-11-03 11:08:23.000000000 -0700
@@ -653,6 +653,12 @@ int netpoll_setup(struct netpoll *np, st
 	unsigned long flags;
 	int err;
 
+	if (ndev->type != ARPHRD_ETHER) {
+		printk(KERN_ERR "netpoll: %s is not an ethernet device\n",
+		       ndev->name);
+		return -EINVAL;
+	}
+
 	np->dev = ndev;
 	if (!ndev->npinfo) {
 		npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL);

-- 
Stephen Hemminger <[email-masked]>