aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/tx.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-08-02 11:50:12 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:50 -0400
commit3cf840914bd467fa4cc76af1a01bba4d2813131c (patch)
treece3adcd8be98a4e1cf5c0968ec8742fbd8fac029 /drivers/net/wireless/libertas/tx.c
parentc95c7f930ec6fee029c8e7957ab95b3967578070 (diff)
[PATCH] libertas: access mesh_dev more carefully
The CF/SDIO firmware doesn't support Mesh, so priv->mesh_dev is NULL there. Protect all accesses. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/tx.c')
-rw-r--r--drivers/net/wireless/libertas/tx.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
index c2271020aafe..7c383014a274 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -159,7 +159,8 @@ done:
159 skb_orphan(skb); 159 skb_orphan(skb);
160 /* stop processing outgoing pkts */ 160 /* stop processing outgoing pkts */
161 netif_stop_queue(priv->dev); 161 netif_stop_queue(priv->dev);
162 netif_stop_queue(priv->mesh_dev); 162 if (priv->mesh_dev)
163 netif_stop_queue(priv->mesh_dev);
163 /* freeze any packets already in our queues */ 164 /* freeze any packets already in our queues */
164 priv->adapter->TxLockFlag = 1; 165 priv->adapter->TxLockFlag = 1;
165 } else { 166 } else {
@@ -198,10 +199,12 @@ static void wlan_tx_queue(wlan_private *priv, struct sk_buff *skb)
198 adapter->tx_queue_ps[adapter->tx_queue_idx++] = skb; 199 adapter->tx_queue_ps[adapter->tx_queue_idx++] = skb;
199 if (adapter->tx_queue_idx == NR_TX_QUEUE) { 200 if (adapter->tx_queue_idx == NR_TX_QUEUE) {
200 netif_stop_queue(priv->dev); 201 netif_stop_queue(priv->dev);
201 netif_stop_queue(priv->mesh_dev); 202 if (priv->mesh_dev)
203 netif_stop_queue(priv->mesh_dev);
202 } else { 204 } else {
203 netif_start_queue(priv->dev); 205 netif_start_queue(priv->dev);
204 netif_start_queue(priv->mesh_dev); 206 if (priv->mesh_dev)
207 netif_start_queue(priv->mesh_dev);
205 } 208 }
206 209
207 spin_unlock(&adapter->txqueue_lock); 210 spin_unlock(&adapter->txqueue_lock);
@@ -285,7 +288,8 @@ void libertas_send_tx_feedback(wlan_private * priv)
285 priv->adapter->TxLockFlag = 0; 288 priv->adapter->TxLockFlag = 0;
286 if (priv->adapter->connect_status == LIBERTAS_CONNECTED) { 289 if (priv->adapter->connect_status == LIBERTAS_CONNECTED) {
287 netif_wake_queue(priv->dev); 290 netif_wake_queue(priv->dev);
288 netif_wake_queue(priv->mesh_dev); 291 if (priv->mesh_dev)
292 netif_wake_queue(priv->mesh_dev);
289 } 293 }
290} 294}
291EXPORT_SYMBOL_GPL(libertas_send_tx_feedback); 295EXPORT_SYMBOL_GPL(libertas_send_tx_feedback);