Re: [PATCH v3 11/26] ASoC: codecs: wcd-mbhc: Use guard() for mutex locks

Mark Brown <[email protected]>
Newsgroups org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound
Message-ID <[email protected]>
On Fri, Jul 31, 2026 at 10:06:33AM +0700, [email protected] 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.
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmpsv1MACgkQJNaLcl1U
h9C1OQf9EXP0htSdWsSyOlW9QYiNmlfv5JrohdnCZ2cGQ09Cq87ZcpF3FKiK3+je
1+llmoy6HFtSkRw9UKwYLHMinjK3IGP/VN0IgjJ6Q6uBaNycdZXvcnjua0VSJvFM
MNV077KbEeFF6hrGtItXh9tuUSuwuBcVUbis+gfgcJz/Gh/ig8b5rrnScXD7GSjz
WKYHqoH0yx5cUkk6UUEVwOD7zOvWYoDxczcQovKHOU+bIS5k2UH62XlRz4jjOmdw
H3Gkb3yrzhIWYwY6wJvPteRmM1RX1T/ejLusu3fRUKOtEkFOySQhnB8GDtFXK5e1
AUSUjXfQkPkX99TBrb9YUOk0nBGAgw==
=ymKr
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.