• Shanyu Zhao's avatar
    iwlwifi: avoid race condition in channel change · aa2dc6b5
    Shanyu Zhao authored
    When iwl_mac_config() is called by mac80211, the channel pointer
    hw->conf->channel can potentially change, resulting in mismatch
    band and channel number when configuring RXON command. To avoid
    this situation, save the channel pointer in local variables
    and validate the channel before using it. Note that priv->mutex
    is locked during the whole function so the local variables are safe.
    
    Same change is applied to iwl_mac_channel_switch() since basically
    it copies code from iwl_mac_config().
    
    Also removed an outdated comment in the flow.
    Signed-off-by: default avatarShanyu Zhao <shanyu.zhao@intel.com>
    Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
    aa2dc6b5
iwl-agn.c 130 KB