Search Linux Wireless

Re: [PATCH] Fix SPARC64 unaligned access in zd_mac_rx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Miller wrote:
From: Michael Buesch <mb@xxxxxxxxx>
Date: Sat, 1 Aug 2009 12:40:16 +0200

On Saturday 01 August 2009 07:23:50 David Miller wrote:
From: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
Date: Fri, 31 Jul 2009 10:39:43 +0200

On Fri, 2009-07-31 at 01:59 -0600, Patrick Simmons wrote:
I'm running zd1211rw on SPARC64 and was getting a lot of "unaligned access" messages in dmesg. I tracked the problem down to this line, and changing the cast to a memcpy fixes the issue. - fc = *(__le16 *)buffer;
+       memcpy(&fc,buffer,sizeof(__le16));
        need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc);
Please use get_unaligned instead.
And, more specifically, one of the endian get_unaligned variants.
No. fc is supposed to be LE.

Ok, I see.

Revised patch below.

Signed-off-by: Patrick Simmons <linuxrocks123@xxxxxxxxxxxx>

--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -694,7 +694,7 @@
                        && !mac->pass_ctrl)
                return 0;

-       fc = *(__le16 *)buffer;
+       fc = get_unaligned(buffer);
        need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc);

        skb = dev_alloc_skb(length + (need_padding ? 2 : 0));


--
If I'm not here, I've gone out to find myself. If I get back before I return, please keep me here.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux