lkml.org 
[lkml]   [2026]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] platform/chrome: cros_ec_typec: Init mutex in Thunderbolt registration
On Tue, May 05, 2026 at 05:34:03AM +0000, Tzung-Bi Shih wrote:
> cros_typec_register_thunderbolt() missed initializing the `adata->lock`
> mutex. This leads to a NULL dereference when the mutex is later
> acquired (e.g. in cros_typec_altmode_work()).
>
> Initialize the mutex in cros_typec_register_thunderbolt() to fix the
> issue.
>
> Cc: stable@vger.kernel.org
> Fixes: 3b00be26b16a ("platform/chrome: cros_ec_typec: Thunderbolt support")
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>

Thanks for the fix!

Reviewed-by: Benson Leung <bleung@chromium.org>


> ---
> drivers/platform/chrome/cros_typec_altmode.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/platform/chrome/cros_typec_altmode.c b/drivers/platform/chrome/cros_typec_altmode.c
> index 557340b53af0..66c546bf89b5 100644
> --- a/drivers/platform/chrome/cros_typec_altmode.c
> +++ b/drivers/platform/chrome/cros_typec_altmode.c
> @@ -359,6 +359,7 @@ cros_typec_register_thunderbolt(struct cros_typec_port *port,
> }
>
> INIT_WORK(&adata->work, cros_typec_altmode_work);
> + mutex_init(&adata->lock);
> adata->alt = alt;
> adata->port = port;
> adata->ap_mode_entry = true;
> --
> 2.54.0.545.g6539524ca2-goog
>
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2026-05-05 19:48    [W:0.075 / U:4.710 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog