Re: [PATCH v3 11/26] ASoC: codecs: wcd-mbhc: Use guard() for mutex locks
From: Mark Brown
Date: Fri Jul 31 2026 - 11:37:58 EST
On Fri, Jul 31, 2026 at 10:06:33AM +0700, phucduc.bui@xxxxxxxxx wrote:
> @@ -419,9 +420,8 @@ static void wcd_cancel_hs_detect_plug(struct wcd_mbhc *mbhc,
> struct work_struct *work)
> {
> mbhc->hs_detect_work_stop = true;
> - mutex_unlock(&mbhc->lock);
> + guard(mutex)(&mbhc->lock);
> cancel_work_sync(work);
> - mutex_lock(&mbhc->lock);
> }
>
This replacing dropping a lock with taking a lock which will both take
the lock twice and deadlock.
Attachment:
signature.asc
Description: PGP signature