Commit 343a8d13 authored by Casey Leedom's avatar Casey Leedom Committed by David S. Miller
Browse files

cxgb4vf: recover from failure in cxgb4vf_open()

If the Link Start fails in cxgb4vf_open(), we need to back out any state
that we've built up ...
Signed-off-by: default avatarCasey Leedom <>
Signed-off-by: default avatarDavid S. Miller <>
parent 60dbb011
......@@ -749,13 +749,19 @@ static int cxgb4vf_open(struct net_device *dev)
netif_set_real_num_tx_queues(dev, pi->nqsets);
err = netif_set_real_num_rx_queues(dev, pi->nqsets);
if (err)
return err;
set_bit(pi->port_id, &adapter->open_device_map);
goto err_unwind;
err = link_start(dev);
if (err)
return err;
goto err_unwind;
set_bit(pi->port_id, &adapter->open_device_map);
return 0;
if (adapter->open_device_map == 0)
return err;
......@@ -764,13 +770,12 @@ static int cxgb4vf_open(struct net_device *dev)
static int cxgb4vf_stop(struct net_device *dev)
int ret;
struct port_info *pi = netdev_priv(dev);
struct adapter *adapter = pi->adapter;
ret = t4vf_enable_vi(adapter, pi->viid, false, false);
t4vf_enable_vi(adapter, pi->viid, false, false);
pi->link_cfg.link_ok = 0;
clear_bit(pi->port_id, &adapter->open_device_map);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment