From patchwork Sat Oct 31 18:21:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 315905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3FDCC388F7 for ; Sat, 31 Oct 2020 18:22:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE13C206D5 for ; Sat, 31 Oct 2020 18:22:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728240AbgJaSV7 (ORCPT ); Sat, 31 Oct 2020 14:21:59 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:56534 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbgJaSV7 (ORCPT ); Sat, 31 Oct 2020 14:21:59 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kYvVl-004XRs-Fq; Sat, 31 Oct 2020 19:21:57 +0100 From: Andrew Lunn To: Jakub Kicinski Cc: netdev , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Andrew Lunn Subject: [PATCH net-next] net: netfilter: Add __printf() attribute Date: Sat, 31 Oct 2020 19:21:44 +0100 Message-Id: <20201031182144.1081847-1-andrew@lunn.ch> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org nft_request_module calls vsnprintf() using parameters passed to it. Make the function with __printf() attribute so the compiler can check the format and arguments. Signed-off-by: Andrew Lunn --- net/netfilter/nf_tables_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 65cb8e3c13d9..522a9d28754b 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -581,7 +581,8 @@ struct nft_module_request { }; #ifdef CONFIG_MODULES -static int nft_request_module(struct net *net, const char *fmt, ...) +static __printf(2, 3) int nft_request_module(struct net *net, const char *fmt, + ...) { char module_name[MODULE_NAME_LEN]; struct nft_module_request *req;