Skip to content

Commit

Permalink
netpoll: call dev_put() on error in netpoll_setup()
Browse files Browse the repository at this point in the history
There is a dev_put(ndev) missing on an error path.  This was
introduced in 0c1ad04 "netpoll: prevent netpoll setup on slave
devices".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Jun 12, 2011
1 parent f1c089e commit 83fe32d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 83fe32d

Please sign in to comment.