linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: Fix unneeded extra initialization in bpf_map_batch_common
@ 2020-01-16  4:59 Brian Vazquez
  2020-01-16 14:33 ` Daniel Borkmann
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Vazquez @ 2020-01-16  4:59 UTC (permalink / raw)
  To: Brian Vazquez, Brian Vazquez, Alexei Starovoitov,
	Daniel Borkmann, David S . Miller
  Cc: Yonghong Song, Andrii Nakryiko, linux-kernel, netdev, bpf,
	Andrii Nakryiko

bpf_attr doesn't required to be declared with '= {}' as memset is used
in the code.

Fixes: 2ab3d86ea1859 ("libbpf: Add libbpf support to batch ops")
Reported-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Brian Vazquez <brianvv@google.com>
---
 tools/lib/bpf/bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 317727d612149..ed42b006533c4 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -457,7 +457,7 @@ static int bpf_map_batch_common(int cmd, int fd, void  *in_batch,
 				__u32 *count,
 				const struct bpf_map_batch_opts *opts)
 {
-	union bpf_attr attr = {};
+	union bpf_attr attr;
 	int ret;
 
 	if (!OPTS_VALID(opts, bpf_map_batch_opts))
-- 
2.25.0.rc1.283.g88dfdc4193-goog


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

* Re: [PATCH bpf-next] libbpf: Fix unneeded extra initialization in bpf_map_batch_common
  2020-01-16  4:59 [PATCH bpf-next] libbpf: Fix unneeded extra initialization in bpf_map_batch_common Brian Vazquez
@ 2020-01-16 14:33 ` Daniel Borkmann
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2020-01-16 14:33 UTC (permalink / raw)
  To: Brian Vazquez, Brian Vazquez, Alexei Starovoitov, David S . Miller
  Cc: Yonghong Song, Andrii Nakryiko, linux-kernel, netdev, bpf,
	Andrii Nakryiko

On 1/16/20 5:59 AM, Brian Vazquez wrote:
> bpf_attr doesn't required to be declared with '= {}' as memset is used
> in the code.
> 
> Fixes: 2ab3d86ea1859 ("libbpf: Add libbpf support to batch ops")
> Reported-by: Andrii Nakryiko <andriin@fb.com>
> Signed-off-by: Brian Vazquez <brianvv@google.com>

Applied, thanks!

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

end of thread, other threads:[~2020-01-16 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16  4:59 [PATCH bpf-next] libbpf: Fix unneeded extra initialization in bpf_map_batch_common Brian Vazquez
2020-01-16 14:33 ` Daniel Borkmann

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).