summaryrefslogtreecommitdiff
path: root/target/linux/mcs814x
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-08-08 21:51:13 +0000
committerFlorian Fainelli <florian@openwrt.org>2012-08-08 21:51:13 +0000
commit5e877f02b4c12076623c5d42a3c4e0ba14221fdd (patch)
treee13c13183983e38c26f01be4093e9c3aea0def41 /target/linux/mcs814x
parent35351a28b9d700fe890fd3cdefd8b82b3343b5e3 (diff)
downloadmtk-20170518-5e877f02b4c12076623c5d42a3c4e0ba14221fdd.zip
mtk-20170518-5e877f02b4c12076623c5d42a3c4e0ba14221fdd.tar.gz
mtk-20170518-5e877f02b4c12076623c5d42a3c4e0ba14221fdd.tar.bz2
nuport-mac: close possible race condition during start
SVN-Revision: 33069
Diffstat (limited to 'target/linux/mcs814x')
-rw-r--r--target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
index ebf95a6..8cd3d0e 100644
--- a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
+++ b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
@@ -809,7 +809,11 @@ static int nuport_mac_open(struct net_device *dev)
nuport_mac_reset_rx_dma(priv);
/* Start RX DMA */
- return nuport_mac_start_rx_dma(priv, priv->rx_skb[0]);
+ spin_lock_irqsave(&priv->lock, flags);
+ ret = nuport_mac_start_rx_dma(priv, priv->rx_skb[0]);
+ spin_unlock_irqrestore(&priv->lock, flags);
+
+ return ret;
out_rx_skb:
nuport_mac_free_rx_ring(priv);