diff mbox series

[bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin

Message ID 20210715110609.29364-1-tklauser@distanz.ch (mailing list archive)
State Accepted
Commit d444b06e40855219ef38b5e9286db16d435f06dc
Delegated to: BPF
Headers show
Series [bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers fail 1 blamed authors not CCed: kuba@kernel.org; 11 maintainers not CCed: netdev@vger.kernel.org yhs@fb.com kpsingh@kernel.org quentin@isovalent.com cong.wang@bytedance.com kafai@fb.com john.fastabend@gmail.com tony.ambardar@gmail.com songliubraving@fb.com jakub@cloudflare.com kuba@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Tobias Klauser July 15, 2021, 11:06 a.m. UTC
Fixes: 49a086c201a9 ("bpftool: implement prog load command")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 tools/bpf/bpftool/common.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Quentin Monnet July 15, 2021, 3:17 p.m. UTC | #1
2021-07-15 13:06 UTC+0200 ~ Tobias Klauser <tklauser@distanz.ch>
> Fixes: 49a086c201a9 ("bpftool: implement prog load command")
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Roman Gushchin July 15, 2021, 3:55 p.m. UTC | #2
On Thu, Jul 15, 2021 at 01:06:09PM +0200, Tobias Klauser wrote:
> Fixes: 49a086c201a9 ("bpftool: implement prog load command")
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Acked-by: Roman Gushchin <guro@fb.com>

Thanks!
patchwork-bot+netdevbpf@kernel.org July 15, 2021, 6:10 p.m. UTC | #3
Hello:

This patch was applied to bpf/bpf.git (refs/heads/master):

On Thu, 15 Jul 2021 13:06:09 +0200 you wrote:
> Fixes: 49a086c201a9 ("bpftool: implement prog load command")
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
>  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
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c
index 1828bba19020..dc6daa193557 100644
--- a/tools/bpf/bpftool/common.c
+++ b/tools/bpf/bpftool/common.c
@@ -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);