selftests/bpf: Fix compile warning in bpf selftest
diff mbox series

Message ID 20190507231224.GA3787@ip-172-31-29-54.us-west-2.compute.internal
State Mainlined
Commit 94e8f3c7125a36c6cedf37c8838cb77c8a8d8cf9
Headers show
Series
  • selftests/bpf: Fix compile warning in bpf selftest
Related show

Commit Message

Alakesh Haloi May 7, 2019, 11:12 p.m. UTC
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(-)

Comments

Alexei Starovoitov May 9, 2019, 8:51 p.m. UTC | #1
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.
Alakesh Haloi May 10, 2019, midnight UTC | #2
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

Patch
diff mbox series

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)