From patchwork Wed Oct 8 10:40:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 5053181 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CCEAFC11AB for ; Wed, 8 Oct 2014 10:40:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8A05201ED for ; Wed, 8 Oct 2014 10:40:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 459E9201CD for ; Wed, 8 Oct 2014 10:40:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755331AbaJHKkk (ORCPT ); Wed, 8 Oct 2014 06:40:40 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:27058 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754192AbaJHKkj (ORCPT ); Wed, 8 Oct 2014 06:40:39 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s98AeVMl013478 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 8 Oct 2014 10:40:32 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s98AeT3E024796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Oct 2014 10:40:30 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s98AeTlp024789; Wed, 8 Oct 2014 10:40:29 GMT Received: from mwanda (/197.157.0.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 08 Oct 2014 03:40:29 -0700 Date: Wed, 8 Oct 2014 13:40:14 +0300 From: Dan Carpenter To: Larry Finger Cc: Jes Sorensen , Greg Kroah-Hartman , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org Subject: [patch] staging: rtl8723au: incorrect use of ether_addr_copy() Message-ID: <20141008104014.GA23096@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The return from myid() isn't aligned correctly for ether_addr_copy(). Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 3eb77de..c8f7890 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -2402,7 +2402,7 @@ void issue_beacon23a(struct rtw_adapter *padapter, int timeout_ms) mgmt->seq_ctrl = 0; ether_addr_copy(mgmt->da, bc_addr); - ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv)); + memcpy(mgmt->sa, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(mgmt->bssid, get_my_bssid23a(cur_network)); /* timestamp will be inserted by hardware */ @@ -2556,7 +2556,7 @@ static void issue_probersp(struct rtw_adapter *padapter, unsigned char *da, cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP); ether_addr_copy(mgmt->da, da); - ether_addr_copy(mgmt->sa, mac); + memcpy(mgmt->sa, mac, ETH_ALEN); ether_addr_copy(mgmt->bssid, bssid); mgmt->seq_ctrl = cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq)); @@ -2718,7 +2718,7 @@ static int _issue_probereq(struct rtw_adapter *padapter, ether_addr_copy(pwlanhdr->addr3, bc_addr); } - ether_addr_copy(pwlanhdr->addr2, mac); + memcpy(pwlanhdr->addr2, mac, ETH_ALEN); pwlanhdr->seq_ctrl = cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq)); @@ -2863,8 +2863,8 @@ static void issue_auth(struct rtw_adapter *padapter, struct sta_info *psta, #ifdef CONFIG_8723AU_AP_MODE unsigned short val16; ether_addr_copy(mgmt->da, psta->hwaddr); - ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv)); - ether_addr_copy(mgmt->bssid, myid(&padapter->eeprompriv)); + memcpy(mgmt->sa, myid(&padapter->eeprompriv), ETH_ALEN); + memcpy(mgmt->bssid, myid(&padapter->eeprompriv), ETH_ALEN); /* setting auth algo number */ val16 = (u16)psta->authalg; @@ -2895,7 +2895,7 @@ static void issue_auth(struct rtw_adapter *padapter, struct sta_info *psta, struct ieee80211_mgmt *iv_mgmt; ether_addr_copy(mgmt->da, get_my_bssid23a(&pmlmeinfo->network)); - ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv)); + memcpy(mgmt->sa, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(mgmt->bssid, get_my_bssid23a(&pmlmeinfo->network)); @@ -3006,7 +3006,7 @@ static void issue_assocrsp(struct rtw_adapter *padapter, unsigned short status, mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | pkt_type); ether_addr_copy(mgmt->da, pstat->hwaddr); - ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv)); + memcpy(mgmt->sa, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(mgmt->bssid, get_my_bssid23a(&pmlmeinfo->network)); mgmt->seq_ctrl = cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq)); @@ -3129,7 +3129,7 @@ static void issue_assocreq(struct rtw_adapter *padapter) cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_REQ); ether_addr_copy(mgmt->da, get_my_bssid23a(&pmlmeinfo->network)); - ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv)); + memcpy(mgmt->sa, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(mgmt->bssid, get_my_bssid23a(&pmlmeinfo->network)); mgmt->seq_ctrl = cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq)); @@ -3400,7 +3400,7 @@ static int _issue_nulldata23a(struct rtw_adapter *padapter, unsigned char *da, pwlanhdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM); ether_addr_copy(pwlanhdr->addr1, da); - ether_addr_copy(pwlanhdr->addr2, myid(&padapter->eeprompriv)); + memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(pwlanhdr->addr3, get_my_bssid23a(&pmlmeinfo->network)); pwlanhdr->seq_ctrl = @@ -3528,7 +3528,7 @@ static int _issue_qos_nulldata23a(struct rtw_adapter *padapter, pwlanhdr->qos_ctrl |= cpu_to_le16(IEEE80211_QOS_CTL_EOSP); ether_addr_copy(pwlanhdr->addr1, da); - ether_addr_copy(pwlanhdr->addr2, myid(&padapter->eeprompriv)); + memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(pwlanhdr->addr3, get_my_bssid23a(&pmlmeinfo->network)); pwlanhdr->seq_ctrl = @@ -3633,7 +3633,7 @@ static int _issue_deauth(struct rtw_adapter *padapter, unsigned char *da, cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH); ether_addr_copy(mgmt->da, da); - ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv)); + memcpy(mgmt->sa, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(mgmt->bssid, get_my_bssid23a(&pmlmeinfo->network)); mgmt->seq_ctrl = cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq)); @@ -3737,7 +3737,7 @@ void issue_action_spct_ch_switch23a(struct rtw_adapter *padapter, cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION); ether_addr_copy(mgmt->da, ra); /* RA */ - ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv)); /* TA */ + memcpy(mgmt->sa, myid(&padapter->eeprompriv), ETH_ALEN); /* TA */ ether_addr_copy(mgmt->bssid, ra); /* DA = RA */ mgmt->seq_ctrl = cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq)); @@ -3799,7 +3799,7 @@ void issue_action_BA23a(struct rtw_adapter *padapter, cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION); ether_addr_copy(mgmt->da, raddr); - ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv)); + memcpy(mgmt->sa, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(mgmt->bssid, get_my_bssid23a(&pmlmeinfo->network)); mgmt->seq_ctrl = cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq)); diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c index 271c33d..976ec2c 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c @@ -219,7 +219,7 @@ ConstructBeacon(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength) cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON); ether_addr_copy(mgmt->da, bc_addr); - ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv)); + memcpy(mgmt->sa, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(mgmt->bssid, get_my_bssid23a(cur_network)); /* A Beacon frame shouldn't have fragment bits set */ diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index bd6953a..cb81e64 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -2414,7 +2414,7 @@ void rtw_cfg80211_indicate_sta_disassoc(struct rtw_adapter *padapter, mgmt.frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH); - ether_addr_copy(mgmt.da, myid(&padapter->eeprompriv)); + memcpy(mgmt.da, myid(&padapter->eeprompriv), ETH_ALEN); ether_addr_copy(mgmt.sa, da); ether_addr_copy(mgmt.bssid, get_my_bssid23a(&pmlmeinfo->network));