NetBpfLoad: prepareLoadMaps() doesn't need mapNames

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0a8f73fc8104dbe1af44395993b634c18fc3b595
This commit is contained in:
Maciej Żenczykowski 2025-07-31 16:17:36 -07:00
commit 3f44c16a15

View file

@ -1242,10 +1242,10 @@ static int loadCodeSections(const char* elfPath, vector<codeSection>& cs, const
}
static int prepareLoadMaps(const struct bpf_object* obj, const vector<struct bpf_map_def>& md,
const vector<string>& mapNames, const unsigned int bpfloader_ver) {
const unsigned int bpfloader_ver) {
unsigned kvers = kernelVersion();
for (int i = 0; i < (int)mapNames.size(); i++) {
for (unsigned i = 0; i < md.size(); i++) {
struct bpf_map* m = bpf_object__find_map_by_name(obj, md[i].name());
if (!m) {
ALOGE("bpf_object does not contain map: %s", md[i].name());
@ -1401,7 +1401,7 @@ static int loadProgByLibbpf(const char* const elfPath, const unsigned int bpfloa
ret = readMapNames(elfFile, mapNames);
if (ret) return ret;
ret = prepareLoadMaps(obj, md, mapNames, bpfloader_ver);
ret = prepareLoadMaps(obj, md, bpfloader_ver);
if (ret) return ret;
ret = readCodeSections(elfFile, cs);