netpoll: call dev_put() on error in netpoll_setup()
authorDan Carpenter <error27@gmail.com>
Sun, 12 Jun 2011 01:55:22 +0000 (18:55 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 Jun 2011 01:55:22 +0000 (18:55 -0700)
There is a dev_put(ndev) missing on an error path.  This was
introduced in 0c1ad04aecb "netpoll: prevent netpoll setup on slave
devices".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/netpoll.c

index 42ea4b0e59f1d3a780d57e9836181f055cb2c006..18d9cbda3a39c0b19d0751350489c08249cba635 100644 (file)
@@ -795,7 +795,8 @@ int netpoll_setup(struct netpoll *np)
        if (ndev->master) {
                printk(KERN_ERR "%s: %s is a slave device, aborting.\n",
                       np->name, np->dev_name);
-               return -EBUSY;
+               err = -EBUSY;
+               goto put;
        }
 
        if (!netif_running(ndev)) {