summaryrefslogtreecommitdiff
path: root/tools/lib/python/jobserver.py
diff options
context:
space:
mode:
authorAnton Protopopov <a.s.protopopov@gmail.com>2025-11-19 11:25:17 +0000
committerAlexei Starovoitov <ast@kernel.org>2025-11-21 17:01:14 -0800
commit4dd3a48d13a3bbe7a48e0ab3f7362be26f534de8 (patch)
treefe5c3cc0ab2552539895821464d4c79f4b488058 /tools/lib/python/jobserver.py
parentb7f7d76d6e354a5acc711da37cb2829ccf40558f (diff)
bpf: Add a check to make static analysers happy
In [1] Dan Carpenter reported that the following code makes the Smatch static analyser unhappy: 17904 value = map->ops->map_lookup_elem(map, &i); 17905 if (!value) 17906 return -EINVAL; --> 17907 items[i - start] = value->xlated_off; The analyser assumes that the `value` variable may contain an error and thus it should be properly checked before the dereference. On practice this will never happen as array maps do not return error values in map_lookup_elem, but to make the Smatch and other possible analysers happy this patch adds a formal check. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/bpf/aR2BN1Ix--8tmVrN@stanley.mountain/ [1] Fixes: 493d9e0d6083 ("bpf, x86: add support for indirect jumps") Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com> Link: https://lore.kernel.org/r/20251119112517.1091793-1-a.s.protopopov@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/python/jobserver.py')
0 files changed, 0 insertions, 0 deletions