@@ -452,9 +452,9 @@ static void cfg80211_mgmt_registrations_update(struct wireless_dev *wdev)
452
452
453
453
lockdep_assert_held (& rdev -> wiphy .mtx );
454
454
455
- spin_lock_bh (& wdev -> mgmt_registrations_lock );
455
+ spin_lock_bh (& rdev -> mgmt_registrations_lock );
456
456
if (!wdev -> mgmt_registrations_need_update ) {
457
- spin_unlock_bh (& wdev -> mgmt_registrations_lock );
457
+ spin_unlock_bh (& rdev -> mgmt_registrations_lock );
458
458
return ;
459
459
}
460
460
@@ -479,7 +479,7 @@ static void cfg80211_mgmt_registrations_update(struct wireless_dev *wdev)
479
479
rcu_read_unlock ();
480
480
481
481
wdev -> mgmt_registrations_need_update = 0 ;
482
- spin_unlock_bh (& wdev -> mgmt_registrations_lock );
482
+ spin_unlock_bh (& rdev -> mgmt_registrations_lock );
483
483
484
484
rdev_update_mgmt_frame_registrations (rdev , wdev , & upd );
485
485
}
@@ -503,6 +503,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,
503
503
int match_len , bool multicast_rx ,
504
504
struct netlink_ext_ack * extack )
505
505
{
506
+ struct cfg80211_registered_device * rdev = wiphy_to_rdev (wdev -> wiphy );
506
507
struct cfg80211_mgmt_registration * reg , * nreg ;
507
508
int err = 0 ;
508
509
u16 mgmt_type ;
@@ -548,7 +549,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,
548
549
if (!nreg )
549
550
return - ENOMEM ;
550
551
551
- spin_lock_bh (& wdev -> mgmt_registrations_lock );
552
+ spin_lock_bh (& rdev -> mgmt_registrations_lock );
552
553
553
554
list_for_each_entry (reg , & wdev -> mgmt_registrations , list ) {
554
555
int mlen = min (match_len , reg -> match_len );
@@ -583,15 +584,15 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,
583
584
list_add (& nreg -> list , & wdev -> mgmt_registrations );
584
585
}
585
586
wdev -> mgmt_registrations_need_update = 1 ;
586
- spin_unlock_bh (& wdev -> mgmt_registrations_lock );
587
+ spin_unlock_bh (& rdev -> mgmt_registrations_lock );
587
588
588
589
cfg80211_mgmt_registrations_update (wdev );
589
590
590
591
return 0 ;
591
592
592
593
out :
593
594
kfree (nreg );
594
- spin_unlock_bh (& wdev -> mgmt_registrations_lock );
595
+ spin_unlock_bh (& rdev -> mgmt_registrations_lock );
595
596
596
597
return err ;
597
598
}
@@ -602,7 +603,7 @@ void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlportid)
602
603
struct cfg80211_registered_device * rdev = wiphy_to_rdev (wiphy );
603
604
struct cfg80211_mgmt_registration * reg , * tmp ;
604
605
605
- spin_lock_bh (& wdev -> mgmt_registrations_lock );
606
+ spin_lock_bh (& rdev -> mgmt_registrations_lock );
606
607
607
608
list_for_each_entry_safe (reg , tmp , & wdev -> mgmt_registrations , list ) {
608
609
if (reg -> nlportid != nlportid )
@@ -615,7 +616,7 @@ void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlportid)
615
616
schedule_work (& rdev -> mgmt_registrations_update_wk );
616
617
}
617
618
618
- spin_unlock_bh (& wdev -> mgmt_registrations_lock );
619
+ spin_unlock_bh (& rdev -> mgmt_registrations_lock );
619
620
620
621
if (nlportid && rdev -> crit_proto_nlportid == nlportid ) {
621
622
rdev -> crit_proto_nlportid = 0 ;
@@ -628,15 +629,16 @@ void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlportid)
628
629
629
630
void cfg80211_mlme_purge_registrations (struct wireless_dev * wdev )
630
631
{
632
+ struct cfg80211_registered_device * rdev = wiphy_to_rdev (wdev -> wiphy );
631
633
struct cfg80211_mgmt_registration * reg , * tmp ;
632
634
633
- spin_lock_bh (& wdev -> mgmt_registrations_lock );
635
+ spin_lock_bh (& rdev -> mgmt_registrations_lock );
634
636
list_for_each_entry_safe (reg , tmp , & wdev -> mgmt_registrations , list ) {
635
637
list_del (& reg -> list );
636
638
kfree (reg );
637
639
}
638
640
wdev -> mgmt_registrations_need_update = 1 ;
639
- spin_unlock_bh (& wdev -> mgmt_registrations_lock );
641
+ spin_unlock_bh (& rdev -> mgmt_registrations_lock );
640
642
641
643
cfg80211_mgmt_registrations_update (wdev );
642
644
}
@@ -784,7 +786,7 @@ bool cfg80211_rx_mgmt_khz(struct wireless_dev *wdev, int freq, int sig_dbm,
784
786
data = buf + ieee80211_hdrlen (mgmt -> frame_control );
785
787
data_len = len - ieee80211_hdrlen (mgmt -> frame_control );
786
788
787
- spin_lock_bh (& wdev -> mgmt_registrations_lock );
789
+ spin_lock_bh (& rdev -> mgmt_registrations_lock );
788
790
789
791
list_for_each_entry (reg , & wdev -> mgmt_registrations , list ) {
790
792
if (reg -> frame_type != ftype )
@@ -808,7 +810,7 @@ bool cfg80211_rx_mgmt_khz(struct wireless_dev *wdev, int freq, int sig_dbm,
808
810
break ;
809
811
}
810
812
811
- spin_unlock_bh (& wdev -> mgmt_registrations_lock );
813
+ spin_unlock_bh (& rdev -> mgmt_registrations_lock );
812
814
813
815
trace_cfg80211_return_bool (result );
814
816
return result ;
0 commit comments