bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/bpf: Fix compile warning in bpf selftest
@ 2019-05-07 23:12 Alakesh Haloi
  2019-05-09 20:51 ` Alexei Starovoitov
  0 siblings, 1 reply; 3+ messages in thread
From: Alakesh Haloi @ 2019-05-07 23:12 UTC (permalink / raw)
  To: Shuah Khan, Alexei Starovoitov, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, linux-kselftest,
	netdev, bpf, linux-kernel

This fixes the following compile time warning

flow_dissector_load.c: In function ‘detach_program’:
flow_dissector_load.c:55:19: warning: format not a string literal and no format arguments [-Wformat-security]
   error(1, errno, command);
                   ^~~~~~~
Signed-off-by: Alakesh Haloi <alakesh.haloi@gmail.com>
---
 tools/testing/selftests/bpf/flow_dissector_load.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/flow_dissector_load.c b/tools/testing/selftests/bpf/flow_dissector_load.c
index 77cafa66d048..7136ab9ffa73 100644
--- a/tools/testing/selftests/bpf/flow_dissector_load.c
+++ b/tools/testing/selftests/bpf/flow_dissector_load.c
@@ -52,7 +52,7 @@ static void detach_program(void)
 	sprintf(command, "rm -r %s", cfg_pin_path);
 	ret = system(command);
 	if (ret)
-		error(1, errno, command);
+		error(1, errno, "%s", command);
 }
 
 static void parse_opts(int argc, char **argv)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests/bpf: Fix compile warning in bpf selftest
  2019-05-07 23:12 [PATCH] selftests/bpf: Fix compile warning in bpf selftest Alakesh Haloi
@ 2019-05-09 20:51 ` Alexei Starovoitov
  2019-05-10  0:00   ` Alakesh Haloi
  0 siblings, 1 reply; 3+ messages in thread
From: Alexei Starovoitov @ 2019-05-09 20:51 UTC (permalink / raw)
  To: Alakesh Haloi
  Cc: Shuah Khan, Alexei Starovoitov, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song,
	open list:KERNEL SELFTEST FRAMEWORK, Network Development, bpf,
	LKML

On Tue, May 7, 2019 at 4:12 PM Alakesh Haloi <alakesh.haloi@gmail.com> wrote:
>
> This fixes the following compile time warning
>
> flow_dissector_load.c: In function ‘detach_program’:
> flow_dissector_load.c:55:19: warning: format not a string literal and no format arguments [-Wformat-security]
>    error(1, errno, command);
>                    ^~~~~~~
> Signed-off-by: Alakesh Haloi <alakesh.haloi@gmail.com>
> ---
>  tools/testing/selftests/bpf/flow_dissector_load.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/flow_dissector_load.c b/tools/testing/selftests/bpf/flow_dissector_load.c
> index 77cafa66d048..7136ab9ffa73 100644
> --- a/tools/testing/selftests/bpf/flow_dissector_load.c
> +++ b/tools/testing/selftests/bpf/flow_dissector_load.c
> @@ -52,7 +52,7 @@ static void detach_program(void)
>         sprintf(command, "rm -r %s", cfg_pin_path);
>         ret = system(command);
>         if (ret)
> -               error(1, errno, command);
> +               error(1, errno, "%s", command);
>  }

it was fixed month ago.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests/bpf: Fix compile warning in bpf selftest
  2019-05-09 20:51 ` Alexei Starovoitov
@ 2019-05-10  0:00   ` Alakesh Haloi
  0 siblings, 0 replies; 3+ messages in thread
From: Alakesh Haloi @ 2019-05-10  0:00 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Shuah Khan, Alexei Starovoitov, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song,
	open list:KERNEL SELFTEST FRAMEWORK, Network Development, bpf,
	LKML

On Thu, May 09, 2019 at 01:51:54PM -0700, Alexei Starovoitov wrote:
> On Tue, May 7, 2019 at 4:12 PM Alakesh Haloi <alakesh.haloi@gmail.com> wrote:
> >
> > This fixes the following compile time warning
> >
> > flow_dissector_load.c: In function ‘detach_program’:
> > flow_dissector_load.c:55:19: warning: format not a string literal and no format arguments [-Wformat-security]
> >    error(1, errno, command);
> >                    ^~~~~~~
> > Signed-off-by: Alakesh Haloi <alakesh.haloi@gmail.com>
> > ---
> >  tools/testing/selftests/bpf/flow_dissector_load.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/bpf/flow_dissector_load.c b/tools/testing/selftests/bpf/flow_dissector_load.c
> > index 77cafa66d048..7136ab9ffa73 100644
> > --- a/tools/testing/selftests/bpf/flow_dissector_load.c
> > +++ b/tools/testing/selftests/bpf/flow_dissector_load.c
> > @@ -52,7 +52,7 @@ static void detach_program(void)
> >         sprintf(command, "rm -r %s", cfg_pin_path);
> >         ret = system(command);
> >         if (ret)
> > -               error(1, errno, command);
> > +               error(1, errno, "%s", command);
> >  }
> 
> it was fixed month ago.
The warning is seen in mainline. I did not try bpf tree. Looks like it
is fixed there. 

Thanks
-Alakesh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-10  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07 23:12 [PATCH] selftests/bpf: Fix compile warning in bpf selftest Alakesh Haloi
2019-05-09 20:51 ` Alexei Starovoitov
2019-05-10  0:00   ` Alakesh Haloi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).