aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r--kernel/bpf/syscall.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index b3c2d09bcf7a..8c91d2b41b1e 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -988,10 +988,15 @@ static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog)
988/* drop refcnt on maps used by eBPF program and free auxilary data */ 988/* drop refcnt on maps used by eBPF program and free auxilary data */
989static void free_used_maps(struct bpf_prog_aux *aux) 989static void free_used_maps(struct bpf_prog_aux *aux)
990{ 990{
991 enum bpf_cgroup_storage_type stype;
991 int i; 992 int i;
992 993
993 if (aux->cgroup_storage) 994 for_each_cgroup_storage_type(stype) {
994 bpf_cgroup_storage_release(aux->prog, aux->cgroup_storage); 995 if (!aux->cgroup_storage[stype])
996 continue;
997 bpf_cgroup_storage_release(aux->prog,
998 aux->cgroup_storage[stype]);
999 }
995 1000
996 for (i = 0; i < aux->used_map_cnt; i++) 1001 for (i = 0; i < aux->used_map_cnt; i++)
997 bpf_map_put(aux->used_maps[i]); 1002 bpf_map_put(aux->used_maps[i]);