From: Johannes Berg Date: Mon, 20 Apr 2009 23:36:59 +0000 (+0200) Subject: mac80211: fix alignment calculation bug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d1bcb9f1273adee6d2ce5edf84f19409a5cc31b9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mac80211: fix alignment calculation bug When checking whether or not a given frame needs to be moved to be properly aligned to a 4-byte boundary, we use & 4 which wasn't intended, this code should check the lowest two bits. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 5fa7aedd90ed..9776f73c51ad 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1397,7 +1397,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) * mac80211. That also explains the __skb_push() * below. */ - align = (unsigned long)skb->data & 4; + align = (unsigned long)skb->data & 3; if (align) { if (WARN_ON(skb_headroom(skb) < 3)) { dev_kfree_skb(skb);