Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933834AbbELUAU (ORCPT ); Tue, 12 May 2015 16:00:20 -0400 Received: from mail-la0-f41.google.com ([209.85.215.41]:35953 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753633AbbELUAR (ORCPT ); Tue, 12 May 2015 16:00:17 -0400 Message-ID: <55525BCD.5030901@gmail.com> Date: Tue, 12 May 2015 22:00:13 +0200 From: Mateusz Kulikowski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Dan Carpenter CC: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 03/33] staging: rtl8192e: Mark unaligned memcpy() References: <1431206361-13736-1-git-send-email-mateusz.kulikowski@gmail.com> <1431206361-13736-4-git-send-email-mateusz.kulikowski@gmail.com> <20150511082646.GI14154@mwanda> In-Reply-To: <20150511082646.GI14154@mwanda> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1069 Lines: 33 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/