]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - samples/bpf/bpf_load.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / samples / bpf / bpf_load.c
index 396e204888b34f342bd8f01afc4e0d1a3d52f823..b86ee54da2d14d6ba0de18481d2c55ed1a70a67b 100644 (file)
@@ -277,6 +277,11 @@ int load_bpf_file(char *path)
        Elf_Data *data, *data_prog, *symbols = NULL;
        char *shname, *shname_prog;
 
+       /* reset global variables */
+       kern_version = 0;
+       memset(license, 0, sizeof(license));
+       memset(processed_sec, 0, sizeof(processed_sec));
+
        if (elf_version(EV_CURRENT) == EV_NONE)
                return 1;
 
@@ -328,6 +333,8 @@ int load_bpf_file(char *path)
 
        /* load programs that need map fixup (relocations) */
        for (i = 1; i < ehdr.e_shnum; i++) {
+               if (processed_sec[i])
+                       continue;
 
                if (get_sec(elf, i, &ehdr, &shname, &shdr, &data))
                        continue;