From patchwork Mon Oct 31 20:51:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13439 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2545731wru; Mon, 31 Oct 2022 14:04:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM408wwbWGAqxvZ5QLHWcTsfwcA/+nwtis+3Ams8GKvtXydYtR2eeDqEVcdqjS+kCx2NwzOh X-Received: by 2002:aa7:dc06:0:b0:461:b683:5fba with SMTP id b6-20020aa7dc06000000b00461b6835fbamr15584355edu.72.1667250278596; Mon, 31 Oct 2022 14:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667250278; cv=none; d=google.com; s=arc-20160816; b=CCn6Ywf0Gc+NAeZYwoNvUogY8CLdlcDsoX9e2v/6z0xO+tg7UZPodIQTo7VlG1I7+t 0gDb/o5pTcOhwjc0XpT1mSzwhSwSP9rue4McDeES1DBnms5beprhfLrBa9zGaaWT2SGi X/Reg76lVbTvuwIFYXiQRjJ3QWRcHu9LPCZMD0Zl+sCsP2F3F8ctC2U9DNqKFnqMKARn mapE6gBVq7SRzRPlOj/n5C2CKYJ2mG4FbaHYdb1UmkIkS+TK0XVc4O0oXWq80j0NAc9u zxaRt2Rloih85FmW6wFyL3xkQS+q52pj5RRmDTwFG37nJTjAQaarUot8UnSR8pTNG/nm tbqA== 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:cc:to:from; bh=fBc8gcMZqD1AAuEuez96ceoS5RcwgE4hmikY7rg0ZM0=; b=pzgahcDTCGp2aa4kY8dnpmOVz7kMEWp5winC/PwbALVPgpxJiZER0lKkMtH6l3n9wT fiL9uiq3s5iK+846yUZSszDxyTj7Lj1wJoi5cli4i/OFBr6pcmgcu4E7fFR/me1PKZ0u 4dSHjX36oaDqOQ0Z6dBb+hjSxYhY8U/JZzMrlnbI8RaFYzJpzPr0TOMGMUwRxgsPVBm1 xCSNEKy9TirtM4VKzV+vndR2UnWUlvIGadA1Bq0NNH1MSHG6nH8HAOY+uahHnZHA2RoQ NzvSyAqgWrVpKjCTfX2+UUhDUIiZLHE7nBMmRHsIOEwbsspM7R1UjbS4M9tNUnQr7Faa qR3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a509307000000b0046107f951f9si9364724eda.237.2022.10.31.14.04.02; Mon, 31 Oct 2022 14:04:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbiJaUwN (ORCPT + 99 others); Mon, 31 Oct 2022 16:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbiJaUwL (ORCPT ); Mon, 31 Oct 2022 16:52:11 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC87213FB6 for ; Mon, 31 Oct 2022 13:52:09 -0700 (PDT) Received: from dslb-084-059-234-234.084.059.pools.vodafone-ip.de ([84.59.234.234] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1opblL-0006y5-FT; Mon, 31 Oct 2022 21:52:03 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser , Joe Perches Subject: [PATCH] staging: r8188eu: use ether_addr_equal in OnAction Date: Mon, 31 Oct 2022 21:51:41 +0100 Message-Id: <20221031205140.124682-1-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748238628273789423?= X-GMAIL-MSGID: =?utf-8?q?1748238628273789423?= Use ether_addr_equal to compare two mac addresses in OnAction. Both struct ieee80211_mgmt and struct eeprom_priv's mac_addr component are 2-byte aligned. Suggested-by: Joe Perches Signed-off-by: Martin Kaiser Tested-by: Philipp Hortmann # Edimax N150 --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index e985fc5fc575..6679d4037d6b 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3823,7 +3823,7 @@ static void OnAction(struct adapter *padapter, struct recv_frame *precv_frame) { struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; - if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) + if (!ether_addr_equal(myid(&padapter->eeprompriv), mgmt->da)) return; switch (mgmt->u.action.category) {