Skip to content

Commit

Permalink
netfilter: nftables: Add __printf() attribute
Browse files Browse the repository at this point in the history
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 <andrew@lunn.ch>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Andrew Lunn authored and Pablo Neira Ayuso committed Nov 1, 2020
1 parent 3976ca1 commit 35b7ee3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 35b7ee3

Please sign in to comment.