]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Correctly propagate errors up from bpf_core_composites_match
authorDaniel Müller <deso@posteo.net>
Thu, 7 Jul 2022 21:19:31 +0000 (21:19 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 8 Jul 2022 22:31:43 +0000 (15:31 -0700)
commit5d56c29be06471e45e6bd8a84f8332c77b92044f
tree30ac39ec317c64eed4b1740cb72dd844e6bf0290
parent8ec095f33a53e7e1717e0d156dfb9310a3b1404a
bpf: Correctly propagate errors up from bpf_core_composites_match

This change addresses a comment made earlier [0] about a missing return
of an error when __bpf_core_types_match is invoked from
bpf_core_composites_match, which could have let to us erroneously
ignoring errors.

Regarding the typedef name check pointed out in the same context, it is
not actually an issue, because callers of the function perform a name
check for the root type anyway. To make that more obvious, let's add
comments to the function (similar to what we have for
bpf_core_types_are_compat, which is called in pretty much the same
context).

[0]: https://lore.kernel.org/bpf/165708121449.4919.13204634393477172905.git-patchwork-notify@kernel.org/T/#m55141e8f8cfd2e8d97e65328fa04852870d01af6

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Müller <deso@posteo.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220707211931.3415440-1-deso@posteo.net
tools/lib/bpf/relo_core.c