diff mbox series

[bpf-next] libbpf: Fix unneeded extra initialization in bpf_map_batch_common

Message ID 20200116045918.75597-1-brianvv@google.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series [bpf-next] libbpf: Fix unneeded extra initialization in bpf_map_batch_common | expand

Commit Message

Brian Vazquez Jan. 16, 2020, 4:59 a.m. UTC
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(-)

Comments

Daniel Borkmann Jan. 16, 2020, 2:33 p.m. UTC | #1
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!
diff mbox series

Patch

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