bpftool: Check malloc return value in mount_bpffs_for_pin
PATCH 1/1 bpftool: Check malloc return value in mount_bpffs_for_pin
Fixes 49a086c201a9 ("bpftool: implement prog load command")
Signed-off-by Tobias Klauser <[email protected]>
--- tools/bpf/bpftool/common.c | 5 +++++ 1 file changed, 5 insertions(+)
tools/bpf/bpftool/common.c +5 -0
@@ -222,6 +222,11 @@ int mount_bpffs_for_pin(const char *name)int err =0 ; file =malloc (strlen (name) +1 ); +if (!file) { +p_err ("mem alloc failed" ); +return -1 ; + } +strcpy (file, name); dir =dirname (file);
Signature · 1 line
2.31.1
2021-07-15 13:06 UTC+0200 ~ Tobias Klauser <[email protected]>
Quoted 2 lines
Fixes 49a086c201a9 ("bpftool: implement prog load command")Signed-off-by Tobias Klauser <[email protected]>
Reviewed-by Quentin Monnet <[email protected]>
Quoted 2 lines · Tobias Klauser
Fixes 49a086c201a9 ("bpftool: implement prog load command")Signed-off-by Tobias Klauser <[email protected]>
Acked-by Roman Gushchin <[email protected]>
Thanks!
This patch was applied to bpf/bpf.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
Quoted 5 lines · On Thu, 15 Jul 2021 13:06:09 +0200 you wrote:
Fixes 49a086c201a9 ("bpftool: implement prog load command")Signed-off-by Tobias Klauser <[email protected]>--- tools/bpf/bpftool/common.c | 5 +++++ 1 file changed, 5 insertions(+)
Here is the summary with links:
- [bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin
https://git.kernel.org/bpf/bpf/c/d444b06e4085
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html