aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/netpoll.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r--net/core/netpoll.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index d10c249bcc8f..7de6dcad5d79 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -698,6 +698,7 @@ int netpoll_setup(struct netpoll *np)
698 struct net_device *ndev = NULL; 698 struct net_device *ndev = NULL;
699 struct in_device *in_dev; 699 struct in_device *in_dev;
700 struct netpoll_info *npinfo; 700 struct netpoll_info *npinfo;
701 const struct net_device_ops *ops;
701 unsigned long flags; 702 unsigned long flags;
702 int err; 703 int err;
703 704
@@ -797,6 +798,13 @@ int netpoll_setup(struct netpoll *np)
797 INIT_DELAYED_WORK(&npinfo->tx_work, queue_process); 798 INIT_DELAYED_WORK(&npinfo->tx_work, queue_process);
798 799
799 atomic_set(&npinfo->refcnt, 1); 800 atomic_set(&npinfo->refcnt, 1);
801
802 ops = np->dev->netdev_ops;
803 if (ops->ndo_netpoll_setup) {
804 err = ops->ndo_netpoll_setup(ndev, npinfo);
805 if (err)
806 goto free_npinfo;
807 }
800 } else { 808 } else {
801 npinfo = ndev->npinfo; 809 npinfo = ndev->npinfo;
802 atomic_inc(&npinfo->refcnt); 810 atomic_inc(&npinfo->refcnt);
@@ -817,6 +825,8 @@ int netpoll_setup(struct netpoll *np)
817 825
818 return 0; 826 return 0;
819 827
828free_npinfo:
829 kfree(npinfo);
820unlock: 830unlock:
821 rtnl_unlock(); 831 rtnl_unlock();
822put: 832put: