* [PATCH net-next] net: netfilter: Add __printf() attribute
@ 2020-10-31 18:21 Andrew Lunn
2020-10-31 18:33 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Lunn @ 2020-10-31 18:21 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev, Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
Andrew Lunn
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>
---
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;
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: netfilter: Add __printf() attribute
2020-10-31 18:21 [PATCH net-next] net: netfilter: Add __printf() attribute Andrew Lunn
@ 2020-10-31 18:33 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2020-10-31 18:33 UTC (permalink / raw)
To: Andrew Lunn; +Cc: Jakub Kicinski, netdev, Jozsef Kadlecsik, Florian Westphal
On Sat, Oct 31, 2020 at 07:21:44PM +0100, Andrew Lunn wrote:
> 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.
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-31 18:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-31 18:21 [PATCH net-next] net: netfilter: Add __printf() attribute Andrew Lunn
2020-10-31 18:33 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox