]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Check malloc return value in mount_bpffs_for_pin
authorTobias Klauser <tklauser@distanz.ch>
Thu, 15 Jul 2021 11:06:09 +0000 (13:06 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 15 Jul 2021 18:01:36 +0000 (20:01 +0200)
commitcf5a52d5b7b4898790c703970f2bf608a252e6b5
treefdf9d10f6aff6fb293f6cf22665fc66fda2151b7
parent4c7680e393d9040a79d03f06d4af6b23b560c5c2
bpftool: Check malloc return value in mount_bpffs_for_pin

Fix and add a missing NULL check for the prior malloc() call.

Fixes: cb5049c147aa ("bpftool: implement prog load command")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Acked-by: Roman Gushchin <guro@fb.com>
Link: https://lore.kernel.org/bpf/20210715110609.29364-1-tklauser@distanz.ch
tools/bpf/bpftool/common.c