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]

 



On Sun, 2009-08-02 at 02:24 -0600, Patrick Simmons wrote:

> It does look wrong, now that I look at it further, but I'm pretty sure 
> that what was happening was that only the lower 8 bits of the 
> dereferenced value were being accessed. 

Yes, you're right, because buffer is a "u8 *", I initially thought that
it didn't take a pointer, but that wouldn't work, of course.

>  What's odd is that it works on 
> my machine, though.  Whatever.  Your version is clearer, in any case.
> 
> What follows is hopefully the last version of this patch.

Looks good, but I think you should resubmit with
 * a changed subject (e.g. "zd1211rw: fix unaligned access in zd_mac_rx")
 * a standalone patch description so John doesn't have to pick it out of
   your first patch etc.


Thanks!
johannes

> 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((__le16*)buffer);
>         need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc);
>  
>         skb = dev_alloc_skb(length + (need_padding ? 2 : 0));
> 
> --Patrick
> 
> 

Attachment: signature.asc
Description: This is a digitally signed message part


[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