From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 665224A341C for ; Tue, 5 May 2026 17:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778003256; cv=none; b=tMvscZB+U1/OQ99p8y8ZibXhNoMp7eDDueXkvRbsPCx6WlHCLp2s1GZKxAoz7QlMZQuHoh8ash1u3Js/tEHIpJSnayWrX2sa+eaOXbjBNKjjq9A1u9F1HPbLfI4HV6KZurPQJ1kNSqExeFpk+K6256sWCcL/UJzT5UhmBQ/AQVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778003256; c=relaxed/simple; bh=lwsN6Ij/KA7Fw1q7jKImkYdqw44KrNH+364KKSge1SM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J+6e/BDNGBV/8RmbK7gYIhnSnPa2PYny7Re7jyqxoJptr122c3Ttbd5FVwqeFRWJQDhAVxYHVI3NB0MPsXcz2DcTURa0/NNOP3H+p9yl5KgsLATGdyZ9s2uZCQ3AxwO3hLmEXT3bGEHQumiX+JVCuOu7g+/vlQN/10QponmwrXg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bZIRr/e8; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bZIRr/e8" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-8353c9f24d2so2000904b3a.3 for ; Tue, 05 May 2026 10:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1778003254; x=1778608054; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jgpomHj2+eyNGfRuF2OuoOdQ3+F2BeBzWU4tDvGhfTU=; b=bZIRr/e8W5EjM2XfvrN9gqkBZnKqS9dPEru1np4JzfTJkETBYuKrvORrzbZDPuzsnF JTM5W9HjtBBUlkwcejKL9V/iv8cYDjE6EXoEVS+aT3KOA6BCTjnH52us/uPQtYyYSDkp eFaHWfzq093B311l9KBWppKuiyATGdgWCee6BoeQLC896ro3bgRzcVP+NH3/2YozDKXu EkJy1rhnuOteYdvZ9v/YTkRay3BF3SI+rpc+yMkaH8f3F8yZ/riIpEndM+uPf9qsIzac uPeHl540RD0LhQi8cvqlKbwdtk6SfgnRqF478l5PbtuIbQlM7c5SLkk1qnehuv7zwkik 6BAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778003254; x=1778608054; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jgpomHj2+eyNGfRuF2OuoOdQ3+F2BeBzWU4tDvGhfTU=; b=rMfC+PGdAmrMcOEdSniwm2+Q/ybdfUicIrLf0HLqcF9BOFOnFg2AlX4u5mFvRSEiii BB5P9jhXbJjb//E6SyIu3saFMbVVEaBf7jo+nRXtOeYCyg0locgvOTJxHwo1OBIpGgiS R5S0c/pp91Tbe/QescWpuzCN6pB6yDb+1AbvXllQM4RbSp3gmAQDGhpykjegXHASTAT7 gO9/IlMRP29zd+fo0ZOU5D3mDaYa7EysVNgzoziVrObGARlIT4PtICcVn8SOApw1EaSM cNts80oGfpTMxdaPqOhXlI6QqQNy2N+QPwlQh6Ep31p7jG/JOoavvpb+lEr6T7nacbS+ bocA== X-Forwarded-Encrypted: i=1; AFNElJ++xQRnkmZk7uJ2hhP4J2W31hR8X7j3vK6V2xIzHfEQd9oTGQIZyahjCNe2zmIoeQOfe0W/2VdKwXlVJWs=@vger.kernel.org X-Gm-Message-State: AOJu0Yw90E7nJpxqAu6LtxU3VY+sX7/XIPduikerPzu8IIenqGbzTJBy MVbGy8dx6cN0421e+2DajVYiPNgpBlRPbf0aVRq1FKN2j7rJf1I3VWtJrdXXGGn1lflafVFYUrm 61op4sg== X-Gm-Gg: AeBDievHDxg/N1x2Vk6GGv46DyvBWSYqxyhst068MThC7oRLudlse3qr/i1Af3TBT1p yD+hN8bwESObzVeyYo5Fghu3EEAVRen069bJEx4WTXHRuXygkS8be/6XHAZX+8HD16wOnoIsVpP 3+xNKTLF4C+WKb9bOM7D1TsWug0LqrDo+rjcB6LVjylbfIU38bQuKX4RWbbNfRHLAEkr/2VsB08 5vfKZhIpVkyNBPHkLspg8lDD7Lru4vIy2DBdjdim4QusYPzsqklYF60v4DbES3P1AdW3ECiOass mMqeoxX0aFw3fFIdNfct1qtzU2VaB7Bn4MFL/e6Y7hpZhNFAGRNDlkMf2pFkaKWcvz0PThp5iAm 4TVQshdM7M16aVA2kaiZYC8yjB+ta861V5OD68Y02cNU4JoDqSMbdktTWYMTWe/tZ29MwUG0PQt 2FdfeUtWzChauSlso1fBUXA9X/Eqpf1G4SS9o/iF2MxOxz18Xg2FYDtuKpMnwFV+8M/svknPxHR 1f7/Q== X-Received: by 2002:a05:6a00:987:b0:82f:98c:1465 with SMTP id d2e1a72fcca58-83923e981dfmr4030032b3a.27.1778003253088; Tue, 05 May 2026 10:47:33 -0700 (PDT) Received: from google.com (51.86.127.34.bc.googleusercontent.com. [34.127.86.51]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-839679c8462sm2840483b3a.38.2026.05.05.10.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 10:47:31 -0700 (PDT) Date: Tue, 5 May 2026 17:47:28 +0000 From: Benson Leung To: Tzung-Bi Shih Cc: Benson Leung , Abhishek Pandit-Subedi , Jameson Thies , Andrei Kuchynski , 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 Message-ID: References: <20260505053403.3335740-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="89axrARWOPcEMaPt" Content-Disposition: inline In-Reply-To: <20260505053403.3335740-1-tzungbi@kernel.org> --89axrARWOPcEMaPt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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()). >=20 > Initialize the mutex in cros_typec_register_thunderbolt() to fix the > issue. >=20 > Cc: stable@vger.kernel.org > Fixes: 3b00be26b16a ("platform/chrome: cros_ec_typec: Thunderbolt support= ") > Signed-off-by: Tzung-Bi Shih Thanks for the fix! Reviewed-by: Benson Leung > --- > drivers/platform/chrome/cros_typec_altmode.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/drivers/platform/chrome/cros_typec_altmode.c b/drivers/platf= orm/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_por= t *port, > } > =20 > INIT_WORK(&adata->work, cros_typec_altmode_work); > + mutex_init(&adata->lock); > adata->alt =3D alt; > adata->port =3D port; > adata->ap_mode_entry =3D true; > --=20 > 2.54.0.545.g6539524ca2-goog >=20 --89axrARWOPcEMaPt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQCtZK6p/AktxXfkOlzbaomhzOwwgUCafotMAAKCRBzbaomhzOw wiYUAP9t4B8VrD/q+NsAmZTAXx6uBt1fGtt47f6A5GGpcwUnvAEAgl/jN09WGS/J 0KFFd/pfEjUIqc1NiX5N3z7ao1t1bQM= =JajR -----END PGP SIGNATURE----- --89axrARWOPcEMaPt--