Skip to content

Commit

Permalink
drivers: staging: rtl8723bs: Fix locking in rtw_scan_timeout_handler()
Browse files Browse the repository at this point in the history
[ Upstream commit 3f46703 ]

Commit cc7ad0d ("drivers: staging: rtl8723bs: Fix deadlock in
rtw_surveydone_event_callback()") besides fixing the deadlock also
modified rtw_scan_timeout_handler() to use spin_[un]lock_irq()
instead of spin_[un]lock_bh().

Disabling the IRQs is not necessary since all code taking this lock
runs from either user contexts or from softirqs

rtw_scan_timeout_handler() is the only function taking pmlmepriv->lock
which uses spin_[un]lock_irq() for this. Switch back to
spin_[un]lock_bh() to make it consistent with the rest of the code.

Fixes: cc7ad0d ("drivers: staging: rtl8723bs: Fix deadlock in rtw_surveydone_event_callback()")
Cc: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230221145326.7808-2-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jwrdegoede authored and gregkh committed May 11, 2023
1 parent 4ab1bac commit c9d6ae1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/rtl8723bs/core/rtw_mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1590,11 +1590,11 @@ void rtw_scan_timeout_handler(struct timer_list *t)
mlmepriv.scan_to_timer);
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;

spin_lock_irq(&pmlmepriv->lock);
spin_lock_bh(&pmlmepriv->lock);

_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);

spin_unlock_irq(&pmlmepriv->lock);
spin_unlock_bh(&pmlmepriv->lock);

rtw_indicate_scan_done(adapter, true);
}
Expand Down

0 comments on commit c9d6ae1

Please sign in to comment.