stmmac: release tx lock, in case of dma mapping error.

Add missing spin_unlock when tx frames gets dropped.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Fabrice Gasnier 2014-11-04 17:08:06 +01:00 committed by David S. Miller
parent 16ee817e43
commit 758a0ab59b
1 changed files with 1 additions and 0 deletions

View File

@ -2026,6 +2026,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK; return NETDEV_TX_OK;
dma_map_err: dma_map_err:
spin_unlock(&priv->tx_lock);
dev_err(priv->device, "Tx dma map failed\n"); dev_err(priv->device, "Tx dma map failed\n");
dev_kfree_skb(skb); dev_kfree_skb(skb);
priv->dev->stats.tx_dropped++; priv->dev->stats.tx_dropped++;