Re: [PATCH v2] staging: rtl8723bs: remove possible deadlock when disconnect

From: Fabio Aiuto
Date: Sat Sep 11 2021 - 06:53:22 EST


Hello Hans,

On Fri, Sep 10, 2021 at 11:06:58PM +0200, Hans de Goede wrote:
> Hi,

<snip>

>
> Thank you for your work on this. Overall this looks good.
>
> I have one remark, since now you are relying on the
> sta->sleep_q.lock to protect the sleep_q data, you also
> need to update the sleep_q accesses in rtw_free_stainfo()
> specifically you need to add a spin_{lock,unlock}_bh(psta->sleep_q.lock)
> around these lines:
>
>
> rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
> psta->sleepq_len = 0;
>
>
> Note there also is a:
>
> spin_lock_bh(&pxmitpriv->lock);
>
> Just above this which needs to be pushed down to below the
> block which takes the psta->sleep_q.lock, so that the entire
> thing ends up looking like this:
>
> spin_lock_bh(&psta->sleep_q.lock);
> rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
> psta->sleepq_len = 0;
> spin_unlock_bh(&psta->sleep_q.lock);
>
> spin_lock_bh(&pxmitpriv->lock);
>
> Other then that this patch looks good, thanks.
>
> Regards,
>
> Hans
>

good catch, thanks a lot for review.

Greg, I see that this one is not in staging-next,
would you drop it so I can send a new one?
Or shall I send a Fixes: patch?

thank you all,

fabio