diff options
-rw-r--r-- | drivers/net/cxgb4vf/cxgb4vf_main.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c index 3c403f895750..56166ae2059f 100644 --- a/drivers/net/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/cxgb4vf/cxgb4vf_main.c | |||
@@ -749,13 +749,19 @@ static int cxgb4vf_open(struct net_device *dev) | |||
749 | netif_set_real_num_tx_queues(dev, pi->nqsets); | 749 | netif_set_real_num_tx_queues(dev, pi->nqsets); |
750 | err = netif_set_real_num_rx_queues(dev, pi->nqsets); | 750 | err = netif_set_real_num_rx_queues(dev, pi->nqsets); |
751 | if (err) | 751 | if (err) |
752 | return err; | 752 | goto err_unwind; |
753 | set_bit(pi->port_id, &adapter->open_device_map); | ||
754 | err = link_start(dev); | 753 | err = link_start(dev); |
755 | if (err) | 754 | if (err) |
756 | return err; | 755 | goto err_unwind; |
756 | |||
757 | netif_tx_start_all_queues(dev); | 757 | netif_tx_start_all_queues(dev); |
758 | set_bit(pi->port_id, &adapter->open_device_map); | ||
758 | return 0; | 759 | return 0; |
760 | |||
761 | err_unwind: | ||
762 | if (adapter->open_device_map == 0) | ||
763 | adapter_down(adapter); | ||
764 | return err; | ||
759 | } | 765 | } |
760 | 766 | ||
761 | /* | 767 | /* |
@@ -764,13 +770,12 @@ static int cxgb4vf_open(struct net_device *dev) | |||
764 | */ | 770 | */ |
765 | static int cxgb4vf_stop(struct net_device *dev) | 771 | static int cxgb4vf_stop(struct net_device *dev) |
766 | { | 772 | { |
767 | int ret; | ||
768 | struct port_info *pi = netdev_priv(dev); | 773 | struct port_info *pi = netdev_priv(dev); |
769 | struct adapter *adapter = pi->adapter; | 774 | struct adapter *adapter = pi->adapter; |
770 | 775 | ||
771 | netif_tx_stop_all_queues(dev); | 776 | netif_tx_stop_all_queues(dev); |
772 | netif_carrier_off(dev); | 777 | netif_carrier_off(dev); |
773 | ret = t4vf_enable_vi(adapter, pi->viid, false, false); | 778 | t4vf_enable_vi(adapter, pi->viid, false, false); |
774 | pi->link_cfg.link_ok = 0; | 779 | pi->link_cfg.link_ok = 0; |
775 | 780 | ||
776 | clear_bit(pi->port_id, &adapter->open_device_map); | 781 | clear_bit(pi->port_id, &adapter->open_device_map); |