Skip to content

Commit

Permalink
mt76: discard early received packets if not running yet
Browse files Browse the repository at this point in the history
If the radio was previously in running state, it can receive some
packets before it is able to process them.
This can lead to a crash if the channel is not initialized yet.
Discard all rx packets until start() is called

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed May 15, 2018
1 parent e87f925 commit 73edb22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mt76x2_mac.c
Expand Up @@ -314,6 +314,9 @@ int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb,
u8 wcid;
int len;

if (!test_bit(MT76_STATE_RUNNING, &dev->mt76.state))
return -EINVAL;

if (rxinfo & MT_RXINFO_L2PAD)
pad_len += 2;

Expand Down

0 comments on commit 73edb22

Please sign in to comment.