Commit 087baf9b authored by Ryder Lee's avatar Ryder Lee Committed by Felix Fietkau

mt76: only access ieee80211_hdr after mt76_insert_ccmp_hdr

Get rid of unsafe access since mt76_insert_ccmp_hdr moves the header.
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent d43de9cf
...@@ -777,7 +777,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb) ...@@ -777,7 +777,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb)
} }
if (!hdr_trans) { if (!hdr_trans) {
struct ieee80211_hdr *hdr = mt76_skb_get_hdr(skb); struct ieee80211_hdr *hdr;
if (insert_ccmp_hdr) { if (insert_ccmp_hdr) {
u8 key_id = FIELD_GET(MT_RXD1_NORMAL_KEY_ID, rxd1); u8 key_id = FIELD_GET(MT_RXD1_NORMAL_KEY_ID, rxd1);
...@@ -785,6 +785,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb) ...@@ -785,6 +785,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb)
mt76_insert_ccmp_hdr(skb, key_id); mt76_insert_ccmp_hdr(skb, key_id);
} }
hdr = mt76_skb_get_hdr(skb);
fc = hdr->frame_control; fc = hdr->frame_control;
if (ieee80211_is_data_qos(fc)) { if (ieee80211_is_data_qos(fc)) {
seq_ctrl = le16_to_cpu(hdr->seq_ctrl); seq_ctrl = le16_to_cpu(hdr->seq_ctrl);
......
...@@ -772,7 +772,7 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb) ...@@ -772,7 +772,7 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb)
} }
if (!hdr_trans) { if (!hdr_trans) {
struct ieee80211_hdr *hdr = mt76_skb_get_hdr(skb); struct ieee80211_hdr *hdr;
if (insert_ccmp_hdr) { if (insert_ccmp_hdr) {
u8 key_id = FIELD_GET(MT_RXD1_NORMAL_KEY_ID, rxd1); u8 key_id = FIELD_GET(MT_RXD1_NORMAL_KEY_ID, rxd1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment