Jelajahi Sumber

mac80211: call skb_put() before copying the data (trivial)

It doesn't have any actual effect here, but we should
skb_put() *before* copying the data.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Eliad Peller 13 tahun lalu
induk
melakukan
5220da39b4
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      net/mac80211/tx.c

+ 1 - 1
net/mac80211/tx.c

@@ -2265,10 +2265,10 @@ static void ieee80211_beacon_add_tim(struct ieee80211_if_ap *bss,
 		/* Bitmap control */
 		/* Bitmap control */
 		*pos++ = n1 | aid0;
 		*pos++ = n1 | aid0;
 		/* Part Virt Bitmap */
 		/* Part Virt Bitmap */
+		skb_put(skb, n2 - n1);
 		memcpy(pos, bss->tim + n1, n2 - n1 + 1);
 		memcpy(pos, bss->tim + n1, n2 - n1 + 1);
 
 
 		tim[1] = n2 - n1 + 4;
 		tim[1] = n2 - n1 + 4;
-		skb_put(skb, n2 - n1);
 	} else {
 	} else {
 		*pos++ = aid0; /* Bitmap control */
 		*pos++ = aid0; /* Bitmap control */
 		*pos++ = 0; /* Part Virt Bitmap */
 		*pos++ = 0; /* Part Virt Bitmap */