提交 20c888be 编写于 作者: A Ajay Singh 提交者: Greg Kroah-Hartman

staging: wilc1000: add check before performing operation on net_device

Before calling an operation on net_device check if that interface is
available.
Signed-off-by: NAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f2bf97cb
...@@ -159,9 +159,11 @@ static int linux_wlan_txq_task(void *vp) ...@@ -159,9 +159,11 @@ static int linux_wlan_txq_task(void *vp)
do { do {
ret = wilc_wlan_handle_txq(dev, &txq_count); ret = wilc_wlan_handle_txq(dev, &txq_count);
if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD) { if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD) {
if (netif_queue_stopped(wl->vif[0]->ndev)) if (wl->vif[0]->mac_opened &&
netif_queue_stopped(wl->vif[0]->ndev))
netif_wake_queue(wl->vif[0]->ndev); netif_wake_queue(wl->vif[0]->ndev);
if (netif_queue_stopped(wl->vif[1]->ndev)) if (wl->vif[1]->mac_opened &&
netif_queue_stopped(wl->vif[1]->ndev))
netif_wake_queue(wl->vif[1]->ndev); netif_wake_queue(wl->vif[1]->ndev);
} }
} while (ret == -ENOBUFS && !wl->close); } while (ret == -ENOBUFS && !wl->close);
...@@ -761,8 +763,10 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -761,8 +763,10 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
linux_wlan_tx_complete); linux_wlan_tx_complete);
if (queue_count > FLOW_CONTROL_UPPER_THRESHOLD) { if (queue_count > FLOW_CONTROL_UPPER_THRESHOLD) {
netif_stop_queue(wilc->vif[0]->ndev); if (wilc->vif[0]->mac_opened)
netif_stop_queue(wilc->vif[1]->ndev); netif_stop_queue(wilc->vif[0]->ndev);
if (wilc->vif[1]->mac_opened)
netif_stop_queue(wilc->vif[1]->ndev);
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册