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)
141141{
142142 unsigned i ;
143143
144- lockdep_register_key (& htab -> lockdep_key );
145144 for (i = 0 ; i < htab -> n_buckets ; i ++ ) {
146145 INIT_HLIST_NULLS_HEAD (& htab -> buckets [i ].head , i );
147146 if (htab_use_raw_lock (htab )) {
@@ -455,6 +454,8 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr)
455454 if (!htab )
456455 return ERR_PTR (- ENOMEM );
457456
457+ lockdep_register_key (& htab -> lockdep_key );
458+
458459 bpf_map_init_from_attr (& htab -> map , attr );
459460
460461 if (percpu_lru ) {
@@ -546,6 +547,7 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr)
546547free_charge :
547548 bpf_map_charge_finish (& htab -> map .memory );
548549free_htab :
550+ lockdep_unregister_key (& htab -> lockdep_key );
549551 kfree (htab );
550552 return ERR_PTR (err );
551553}
@@ -1364,9 +1366,9 @@ static void htab_map_free(struct bpf_map *map)
13641366
13651367 free_percpu (htab -> extra_elems );
13661368 bpf_map_area_free (htab -> buckets );
1367- lockdep_unregister_key (& htab -> lockdep_key );
13681369 for (i = 0 ; i < HASHTAB_MAP_LOCK_COUNT ; i ++ )
13691370 free_percpu (htab -> map_locked [i ]);
1371+ lockdep_unregister_key (& htab -> lockdep_key );
13701372 kfree (htab );
13711373}
13721374
You can’t perform that action at this time.
0 commit comments