Commit 731a4702 authored by Tomasz Michalec's avatar Tomasz Michalec Committed by Tzung-Bi Shih
Browse files

platform/chrome: cros_ec_typec: Check ec platform device pointer



It is possible that parent device for cros_ec_typec device is already
available, but ec pointer in parent driver data isn't populated yet. It
may happen when cros_typec_probe is running in parallel with
cros_ec_register. This leads to NULL pointer dereference when
cros_typec_probe tries to get driver data from typec->ec->ec->dev.

Check if typec->ec->ec is set before using it in cros_typec_probe.

Signed-off-by: default avatarTomasz Michalec <tmichalec@google.com>
Link: https://lore.kernel.org/r/20250722132826.707087-1-tmichalec@google.com


Signed-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
parent e2374953
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment