[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150513082254.GQ14154@mwanda>
Date: Wed, 13 May 2015 11:22:54 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Mateusz Kulikowski <mateusz.kulikowski@...il.com>
Cc: devel@...verdev.osuosl.org, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 03/33] staging: rtl8192e: Mark unaligned memcpy()
On Tue, May 12, 2015 at 10:00:13PM +0200, Mateusz Kulikowski wrote:
> 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".
You must have forgotten something... Everything after the pointer is
going to be aligned sizeof(void *).
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists