Commit 525cb7ba authored by Tzung-Bi Shih's avatar Tzung-Bi Shih
Browse files

platform/chrome: cros_ec_typec: Init mutex in Thunderbolt registration



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: 3b00be26 ("platform/chrome: cros_ec_typec: Thunderbolt support")
Reviewed-by: default avatarBenson Leung <bleung@chromium.org>
Reviewed-by: default avatarAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
Link: https://lore.kernel.org/r/20260505053403.3335740-1-tzungbi@kernel.org


Signed-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
parent 168e4b20
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;