File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,6 @@ static void htab_init_buckets(struct bpf_htab *htab)
141
141
{
142
142
unsigned i ;
143
143
144
- lockdep_register_key (& htab -> lockdep_key );
145
144
for (i = 0 ; i < htab -> n_buckets ; i ++ ) {
146
145
INIT_HLIST_NULLS_HEAD (& htab -> buckets [i ].head , i );
147
146
if (htab_use_raw_lock (htab )) {
@@ -455,6 +454,8 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr)
455
454
if (!htab )
456
455
return ERR_PTR (- ENOMEM );
457
456
457
+ lockdep_register_key (& htab -> lockdep_key );
458
+
458
459
bpf_map_init_from_attr (& htab -> map , attr );
459
460
460
461
if (percpu_lru ) {
@@ -546,6 +547,7 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr)
546
547
free_charge :
547
548
bpf_map_charge_finish (& htab -> map .memory );
548
549
free_htab :
550
+ lockdep_unregister_key (& htab -> lockdep_key );
549
551
kfree (htab );
550
552
return ERR_PTR (err );
551
553
}
@@ -1364,9 +1366,9 @@ static void htab_map_free(struct bpf_map *map)
1364
1366
1365
1367
free_percpu (htab -> extra_elems );
1366
1368
bpf_map_area_free (htab -> buckets );
1367
- lockdep_unregister_key (& htab -> lockdep_key );
1368
1369
for (i = 0 ; i < HASHTAB_MAP_LOCK_COUNT ; i ++ )
1369
1370
free_percpu (htab -> map_locked [i ]);
1371
+ lockdep_unregister_key (& htab -> lockdep_key );
1370
1372
kfree (htab );
1371
1373
}
1372
1374
You can’t perform that action at this time.
0 commit comments