Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3D3BE728D9 for ; Fri, 29 Sep 2023 19:19:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233327AbjI2TTd (ORCPT ); Fri, 29 Sep 2023 15:19:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233392AbjI2TTc (ORCPT ); Fri, 29 Sep 2023 15:19:32 -0400 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 588121B3 for ; Fri, 29 Sep 2023 12:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nwl.cc; s=mail2022; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7M3a0DNrA/jMIBVY3qJd4MhM+qmax6UnYiqaIzoCN/0=; b=UEHQ1l4ylcTuJZW7bopcVQKu11 fhIzZilNk1o8JTdkA8RaGZxi7vH+VZJQhqF2Zyc3lZ8loscbUJpVLaNCObtiFIDi+NctR3RcIcz7X RTBQtmuDEctPzoFo9Y2dFW/fA1HWkUu1IbJLXXV0yhFNgFa/v0rL4DMqI/aKCqJdA5S9NC0999cFn cN+zNMgXOErMPD87Pj7Uueh0u8pAd1Vlha0p7IsnoFudDkN8h8wOzZ+mN4DNzIlxOijnuiff17iro gO3mv5EJXAYGNbYUW01dMvmFnyx/a/lo5M+Iq+yt8dSAoB/nUQE9NeeC87QqOQ1PpB71lnsHYS0kp Xt0xVANg==; Received: from localhost ([::1] helo=xic) by orbyte.nwl.cc with esmtp (Exim 4.94.2) (envelope-from ) id 1qmJ1L-0005EU-Os; Fri, 29 Sep 2023 21:19:27 +0200 From: Phil Sutter To: Pablo Neira Ayuso Cc: Florian Westphal , netfilter-devel@vger.kernel.org Subject: [nf-next PATCH 2/5] netfilter: nf_tables: Drop pointless memset when dumping rules Date: Fri, 29 Sep 2023 21:19:19 +0200 Message-ID: <20230929191922.6230-3-phil@nwl.cc> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230929191922.6230-1-phil@nwl.cc> References: <20230929191922.6230-1-phil@nwl.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org None of the dump callbacks uses netlink_callback::args beyond the first element, no need to zero the data. Fixes: 96518518cc417 ("netfilter: add nftables") Signed-off-by: Phil Sutter --- net/netfilter/nf_tables_api.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index c033671baa7e7..8ae87a32753b2 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -3465,10 +3465,6 @@ static int __nf_tables_dump_rules(struct sk_buff *skb, goto cont_skip; if (*idx < s_idx) goto cont; - if (*idx > s_idx) { - memset(&cb->args[1], 0, - sizeof(cb->args) - sizeof(cb->args[0])); - } if (prule) handle = prule->handle; else -- 2.41.0