From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 4E77BAABC for ; Wed, 9 May 2018 11:54:53 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id l1-v6so26610600wmb.2 for ; Wed, 09 May 2018 02:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HIneBf67d3WuHg/YqYDQhvHee86o8k1Ao2uxTC4/6sA=; b=1ipsv//Ttmv2KReinSUTLPoKe6yVodl3Z1L2yh93UagwgVI/WMwjgr5kr2xsHmCiW+ QCXDADJk/u3xnQkAKOZZ2wq38YCgFlK+tw4PN+l2W6jyfVYWfwThPhMP7nAVDxoY+Act DRaIIweInKgDEuMMGEMLtbT2MkmSPWNom6e/YLUGRna6YpRytcETWtZwHG8qsR19I9kL wvNdXyj9ogSIzzoBVFTTjvqHdcCagMpE+ejAH+9PSUC0wm9UQYenZ7N+ImZfGtx5Ea2E 4EGLkSWzKo+WiwTC/YoqxJLEvsXnufIz7TJpYleYy1JBu+JeZwUA8w90sEnO3u8VYLnM OsKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HIneBf67d3WuHg/YqYDQhvHee86o8k1Ao2uxTC4/6sA=; b=iq1osXXgbWX7Q8/KUGWCcAwGzhDd0/ixHW60loPIMER9LKthSQr5egu+1W/ycKrCQ/ 70EDzOoE+oC8+I86ZCITxqY9pXFol/Snf9fYdv2ADSEpJbHxFAMyJDLIgn9EYtlLpOZf zErB0WNlTr7PupzRtcn/HKyF49Ljycx2ZMgx4o92bCClJmFj/31ImpSFW7O8IWpLSmr0 dXNIsZDocfjwEKCiqDCBbJ4J9yEN3x7CzzuKfvgM5XDyM9WqyWjyUOz1AtsPpPR6JcoW yP7j7Dccj56XmLePoYeuttFThMwayacmWFLPLzmbOtCKBZ927eG1rAon9PCavnD3mEgv 9QNA== X-Gm-Message-State: ALQs6tDd8Lym+S6gVllSHwCuhpnZldFYS9rKAMwLOizhtiE7mWuHIjTi rS7LwZHsek+YKcHDJq4C7XGoDG+i0V9NTj3ScrpX8xsD X-Google-Smtp-Source: AB8JxZpe0xNPpOht+fPkZ0MJ5LL0U5Ol/MPcPRIvxEcj8G5ETemZ0xVdwYhZ91zTKZwYMW7YiTvgNvb4yHQRtAiCzCM= X-Received: by 2002:aa7:d0d2:: with SMTP id u18-v6mr57494397edo.97.1525859693133; Wed, 09 May 2018 02:54:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.212.155 with HTTP; Wed, 9 May 2018 02:54:52 -0700 (PDT) In-Reply-To: <152582948593.6809.11000716617448256936.stgit@localhost.localdomain> References: <152582834896.6809.14521072557832633661.stgit@localhost.localdomain> <152582948593.6809.11000716617448256936.stgit@localhost.localdomain> From: Alejandro Lucero Date: Wed, 9 May 2018 10:54:52 +0100 Message-ID: To: Andy Green Cc: dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2 07/18] drivers/net/nfp: don't memcpy out of source range X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2018 09:54:53 -0000 On Wed, May 9, 2018 at 2:31 AM, Andy Green wrote: > /home/agreen/projects/dpdk/drivers/net/nfp/nfp_net.c:669:2: > error: =E2=80=98memcpy=E2=80=99 forming offset [5, 6] is out of the bound= s > [0, 4] of object =E2=80=98tmp=E2=80=99 with type =E2=80=98uint32_t=E2=80= =99 {aka =E2=80=98unsigned > int=E2=80=99} [-Werror=3Darray-bounds] memcpy(&hw->mac_addr[0], > &tmp, sizeof(struct ether_addr)); > > Signed-off-by: Andy Green > --- > drivers/net/nfp/nfp_net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c > index 048324ec9..199aac40b 100644 > --- a/drivers/net/nfp/nfp_net.c > +++ b/drivers/net/nfp/nfp_net.c > @@ -666,7 +666,7 @@ nfp_net_vf_read_mac(struct nfp_net_hw *hw) > uint32_t tmp; > > tmp =3D rte_be_to_cpu_32(nn_cfg_readl(hw, NFP_NET_CFG_MACADDR)); > - memcpy(&hw->mac_addr[0], &tmp, sizeof(struct ether_addr)); > + memcpy(&hw->mac_addr[0], &tmp, 4); > > tmp =3D rte_be_to_cpu_32(nn_cfg_readl(hw, NFP_NET_CFG_MACADDR + 4= )); > memcpy(&hw->mac_addr[4], &tmp, 2); > > Acked-by: Alejandro Lucero Tested-by: Alejandro Lucero