Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3267173pxj; Tue, 11 May 2021 00:04:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQArz//xfLoHRSWhCm2gGm38TWL6vkd+nP9k//TgNX93Fmtx//RywEmvaQDSfIplWHCCFu X-Received: by 2002:a05:6830:1686:: with SMTP id k6mr25577661otr.123.1620716681857; Tue, 11 May 2021 00:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620716681; cv=none; d=google.com; s=arc-20160816; b=Ot5L960yh5D8FyWlG4/O3WYApof5GlZH6+vTATm66LA9H1zxEeIWS0TkqYBYaUcAHh NC4VJxmSP6H1bfsrQVbvYN9Kx8+qbEGPAdu/rbRt/efPtpKDVpZwEvfJW8i8AoNhrsIn nwSGtKEhJUiHLEf+AFLnCYv22IPNJZMO5r73b3VT6HexQ9oY6+y6HMwYxw2xnBVNhjTU uOaYgmoPLNfEelkXUREHU41OaY4Rxsjbhc0OplSkjLnGpJDe//oPXXXsCLzePUWPx75b 2nAu6NPacwgj4a2WF9izYA8q/uCDz6O44ZCEIpT+1C9VzqSsr+7zgBfiJKg0LDeU+My3 1G6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=M5SLMtOJ4pPAk2pyPXgLUn5MH1X0rZ/S6qlMjU3TY40=; b=YmrBqi8ah6jDRB7Dzy7exSe9BsypkkQvSHDBgN2fOWNUEiDUejk0kOdiiGBggt8kJm PG1bIJEgilY3vG3HVu6q9j2XfxXGfwVf5ZNobsCLC3nV4itvjk2X+GGha8ltrD5YDSXH AtoTB4MNOqLw1CcOQ2dDodlCvFI42CK6S0/G9rPIdefLkgh7EBsFrMs9PXzeE9D8//Xu VWTBnOF+a10P8/llt4Dsm/4spwNEvxxKdDFC4JxdrOah4wVP1YituEEiCGy3JYdnjnHk 8cl1ydemAPnsyZG9pzfWXzQN5kyoDPLscQMGQfcyu3hcwv/AHXibTLrmtms8slydSlG+ RTxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b1IB5KG7; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si4439261ile.43.2021.05.11.00.04.23; Tue, 11 May 2021 00:04:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b1IB5KG7; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230361AbhEKHFS (ORCPT + 99 others); Tue, 11 May 2021 03:05:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39673 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbhEKHFR (ORCPT ); Tue, 11 May 2021 03:05:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620716648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M5SLMtOJ4pPAk2pyPXgLUn5MH1X0rZ/S6qlMjU3TY40=; b=b1IB5KG7vt8NuU+2wrC4o2ldady72GuYPoCwinegdqX/vkigaJl3j5M36XglUAKMKorcJm 681cHM7GcLyAajKu7tEk0Cz04RwlmWDpi/3SGRwObjoXoDF2s3Kl/6ESIyp4PvTouak9uI ycJRqpx2XCbU3YjK7wERtlmcuJaQEgY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-22-P0i_Ied0NtyPIO4VyNkndg-1; Tue, 11 May 2021 03:04:05 -0400 X-MC-Unique: P0i_Ied0NtyPIO4VyNkndg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 086716D504; Tue, 11 May 2021 07:04:04 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-191.ams2.redhat.com [10.36.112.191]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3DCD2E175; Tue, 11 May 2021 07:04:00 +0000 (UTC) From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= To: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Chung-hsien Hsu , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] BRCM80211: improve readability on addresses copy Date: Tue, 11 May 2021 09:02:58 +0200 Message-Id: <20210511070257.7843-1-ihuguet@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org A static analyzer identified as a potential bug the copy of 12 bytes from a 6 bytes array to a 6 bytes array. Both arrays are 6 bytes addresses. Although not being a real bug, it is not immediately clear why is done this way: next 6 bytes address, contiguous to the first one, must also be copied to next contiguous 6 bytes address of the destination. Copying each one separately will make both static analyzers and reviewers happier. Signed-off-by: Íñigo Huguet --- drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c index 763e0ec583d7..26de1bd7fee9 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c @@ -6607,7 +6607,8 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw, rts->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS); - memcpy(&rts->ra, &h->addr1, 2 * ETH_ALEN); + memcpy(&rts->ra, &h->addr1, ETH_ALEN); + memcpy(&rts->ta, &h->addr2, ETH_ALEN); } /* mainrate -- 2.31.1