public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benson Leung <bleung@google.com>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: Benson Leung <bleung@chromium.org>,
	Abhishek Pandit-Subedi <abhishekpandit@chromium.org>,
	Jameson Thies <jthies@google.com>,
	Andrei Kuchynski <akuchynski@chromium.org>,
	chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] platform/chrome: cros_ec_typec: Init mutex in Thunderbolt registration
Date: Tue, 5 May 2026 17:47:28 +0000	[thread overview]
Message-ID: <afotMJqvwYevy6U-@google.com> (raw)
In-Reply-To: <20260505053403.3335740-1-tzungbi@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2026-05-05 17:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  5:34 [PATCH] platform/chrome: cros_ec_typec: Init mutex in Thunderbolt registration Tzung-Bi Shih
2026-05-05 17:39 ` Abhishek Pandit-Subedi
2026-05-05 17:47 ` Benson Leung [this message]
2026-05-06  2:28 ` Tzung-Bi Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afotMJqvwYevy6U-@google.com \
    --to=bleung@google.com \
    --cc=abhishekpandit@chromium.org \
    --cc=akuchynski@chromium.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=jthies@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tzungbi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox