Skip to content

Commit 23ae72e

Browse files
Tzung-Bi Shihgregkh
authored andcommitted
platform/chrome: cros_ec_typec: Init mutex in Thunderbolt registration
commit 525cb7b upstream. 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: 3b00be2 ("platform/chrome: cros_ec_typec: Thunderbolt support") Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> Link: https://lore.kernel.org/r/20260505053403.3335740-1-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2b56d79 commit 23ae72e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/platform/chrome/cros_typec_altmode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ cros_typec_register_thunderbolt(struct cros_typec_port *port,
359359
}
360360

361361
INIT_WORK(&adata->work, cros_typec_altmode_work);
362+
mutex_init(&adata->lock);
362363
adata->alt = alt;
363364
adata->port = port;
364365
adata->ap_mode_entry = true;

0 commit comments

Comments
 (0)