From: Gertjan van Wingerde Date: Fri, 4 Dec 2009 22:47:04 +0000 (+0100) Subject: rt2x00: Only remove L2 padding in received frames if there is payload. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b734083349d1f1aab1edc810cef02e8046251b48;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git rt2x00: Only remove L2 padding in received frames if there is payload. L2 padding will only be present when there is actual payload present. Signed-off-by: Gertjan van Wingerde Acked-by: Ivo van Doorn Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index cc6bcc5a20c7..d7711e4d4751 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c @@ -401,7 +401,9 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev, (rxdesc.flags & RX_FLAG_IV_STRIPPED)) rt2x00crypto_rx_insert_iv(entry->skb, header_length, &rxdesc); - else if (rxdesc.dev_flags & RXDONE_L2PAD) + else if (header_length && + (rxdesc.size > header_length) && + (rxdesc.dev_flags & RXDONE_L2PAD)) rt2x00queue_remove_l2pad(entry->skb, header_length); else rt2x00queue_align_payload(entry->skb, header_length);