lkml.org 
[lkml]   [2015]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 03/33] staging: rtl8192e: Mark unaligned memcpy()
On 11.05.2015 10:26, Dan Carpenter wrote:
(...)
>> */
>> skb_pull(sub_skb, SNAP_SIZE);
>> - memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN);
>> - memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN);
>> + memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src,
>> + ETH_ALEN); /* Must be unaligned */
>
>
> Which part isn't aligned? I think they both are.
>
struct rtllib_rxb *prxb = prxbIndicateArray[j];

struct rtllib_rxb {
u8 nr_subframes;
struct sk_buff *subframes[MAX_SUBFRAME_COUNT == 64];
u8 dst[ETH_ALEN]; // here
u8 src[ETH_ALEN]; // here
} __packed;

Either I forgot alignment / packing rules or this fields are never aligned "by design".

If I remember correctly - I missed it in the first version as well, but then
added BUG into ether_addr_copy().

Regards,
Mateusz


\
 
 \ /
  Last update: 2015-05-12 22:21    [W:0.180 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site