Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6652960iob; Wed, 11 May 2022 02:20:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza3TInaWVPApelnRpoiZmdSkG2Dcdh1vbvaBBI0wYKm0UKfoB7cJVrJoDRdfyvJ+Zs1JW8 X-Received: by 2002:a17:90a:7c4c:b0:1dc:26a1:b82f with SMTP id e12-20020a17090a7c4c00b001dc26a1b82fmr4306461pjl.148.1652260831839; Wed, 11 May 2022 02:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652260831; cv=none; d=google.com; s=arc-20160816; b=La0WzimhsqvAi3A2LZpYQLXRXpxor0qWml7D1Pb2WiEhKopzVgz7UGO36ZS9mmsvJT eTj9Zc/0GkQd6ExNQckJ5TvR+l7FKLpUDqjaCwyrgvsv/3pVaUVpeaWfVzGKR+H2EGTj t5eHz7qoRsPMIjhqIDEPvjQ44AWnnBA9MBbnbe/Cs76OiZFqtc430r78FFXff8gA0ISn QNAtn865lp2/12RPUUlV+RAihV04ubWpamnXwt++Mqm76wGEESBnUk3wWfj7FaxM5HOy 4MwEOltpfW69C0jT66UVmS347lJoYSw//+HESWxCH71yhs2H7gGXWi2nAbPIxCIamE0t eRiQ== 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=N0zAviOGcvHtPSyf8ySYUSlELBH+z4sxSHNZUlb/GzI=; b=JUXV8cNrVIb3+imHgoam4iXWVlzHPNbzD5IXHZosa5Bw6YJ8Krxsx1kmK7/9J3iQvX VaPK308jg7+gFM+S37sZkw4Ji3nYozC4hipR9FHjac93qpcn40sFjuLOZFYMFb6jRfVO QjPwm8fkBoy2l7RCkaIil+QC1RveVMLwR4PjFuCcDRNFl9izpjTXHsazFl7hTONLfuan 0nqlDnSZ/EZWUJtliQMLkrHAM3oxewV2q3KDlnW5p4w1l+GeuIvBn0CC51iaRrobKnCS viyvQNWzjahCqQ+eSSColTOYBrIqGn8NPDN9zTygr71w6sbrwu2KRSM2VbDtsG0KVAqq ZgkA== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u17-20020a63b551000000b003a0bfc020ecsi2300686pgo.32.2022.05.11.02.20.20; Wed, 11 May 2022 02:20:31 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234305AbiEKC5L (ORCPT + 99 others); Tue, 10 May 2022 22:57:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbiEKC5F (ORCPT ); Tue, 10 May 2022 22:57:05 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DD7849F35; Tue, 10 May 2022 19:57:03 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Kyfgk0rclzbng6; Wed, 11 May 2022 10:56:34 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 11 May 2022 10:57:02 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 11 May 2022 10:57:01 +0800 From: Yang Yingliang To: , , , CC: , , Subject: [PATCH] net: ethernet: mediatek: ppe: fix wrong size passed to memset() Date: Wed, 11 May 2022 11:08:29 +0800 Message-ID: <20220511030829.3308094-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 'foe_table' is a pointer, the real size of struct mtk_foe_entry should be pass to memset(). Fixes: ba37b7caf1ed ("net: ethernet: mtk_eth_soc: add support for initializing the PPE") Signed-off-by: Yang Yingliang --- drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c index 3ad10c793308..66298e2235c9 100644 --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c @@ -395,7 +395,7 @@ static void mtk_ppe_init_foe_table(struct mtk_ppe *ppe) static const u8 skip[] = { 12, 25, 38, 51, 76, 89, 102 }; int i, k; - memset(ppe->foe_table, 0, MTK_PPE_ENTRIES * sizeof(ppe->foe_table)); + memset(ppe->foe_table, 0, MTK_PPE_ENTRIES * sizeof(*ppe->foe_table)); if (!IS_ENABLED(CONFIG_SOC_MT7621)) return; -- 2.25.1