Re: [PATCH] rtl8180: avoid accessing the data mapped to streaming DMA

From
Jakub Kicinski <kuba@kernel.org>
Date
2020-10-19 18:43:24
Also in
lkml, netdev
Reply to
Jia-Ju Bai, 2020-10-19
On Mon, 19 Oct 2020 10:54:20 +0800 Jia-Ju Bai wrote:
quoted hunk ↗ jump to hunk
+	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+			priv->seqno += 0x10;
+		hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
+		hdr->seq_ctrl |= cpu_to_le16(priv->seqno);
+	}
+
 	mapping = dma_map_single(&priv->pdev->dev, skb->data, skb->len,
 				 DMA_TO_DEVICE);
 
@@ -534,13 +541,6 @@ static void rtl8180_tx(struct ieee80211_hw *dev,
 
 	spin_lock_irqsave(&priv->lock, flags);
 
-	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
-		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
-			priv->seqno += 0x10;
You're taking the priv->seqno access and modification from under
priv->lock. Is that okay?
Thread (3 messages) 3 messages, 3 authors, last reply 2020-10-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help