ucode-mod-bpf: fix stale errno when rodata map is missing

bpf_object__next_map does not set errno when it runs out of maps, so
the reported error code was whatever errno happened to hold. With
errno 0 the failure was invisible to error(). Report ENOENT instead.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau
2026-07-20 10:43:36 +02:00
parent e04461835a
commit 05208d9a7e
+1 -1
View File
@@ -129,7 +129,7 @@ uc_bpf_module_set_opts(struct bpf_object *obj, uc_value_t *opts)
}
if (!map)
err_return_int(errno, "rodata map");
err_return_int(ENOENT, "rodata map");
if (bpf_map__set_initial_value(map, ucv_string_get(val),
ucv_string_length(val)))