Hello,
A null pointer check is performed for the input parameter “map”.
It looks suspicious that the function “PTR_ERR” is applied then for
a corresponding return statement.
https://elixir.bootlin.com/linux/v6.8-rc2/source/tools/perf/util/bpf_map.c#L29
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/bpf_map.c?h=v6.8-rc2&id=41bccc98fb7931d63d03f326a746ac4d429c1dd3#n29
This issue was detected by using the Coccinelle software.
Would any other error code determination be more appropriate here?
Regards,
Markus
> A null pointer check is performed for the input parameter “map”.
> It looks suspicious that the function “PTR_ERR” is applied then for
> a corresponding return statement.
Are contributions also by YueHaibing still waiting on further development considerations?
[PATCH -next] perf: Fix pass 0 to PTR_ERR
https://lore.kernel.org/lkml/[email protected]/
https://lkml.org/lkml/2022/6/11/3
Regards,
Markus
Hello,
On Thu, Feb 1, 2024 at 10:49 PM Markus Elfring <[email protected]> wrote:
>
> > A null pointer check is performed for the input parameter “map”.
> > It looks suspicious that the function “PTR_ERR” is applied then for
> > a corresponding return statement.
>
> Are contributions also by YueHaibing still waiting on further development considerations?
>
> [PATCH -next] perf: Fix pass 0 to PTR_ERR
> https://lore.kernel.org/lkml/[email protected]/
> https://lkml.org/lkml/2022/6/11/3
I think we dropped the bpf-loader and it seems bpf_map.[ch] is
leftover. I don't see any users of bpf_map__fprintf() in the tree.
Maybe we can drop it too.
Thanks,
Namhyung