diff options
author | Denis Brockus <dbrockus@chromium.org> | 2020-01-10 07:56:55 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-14 00:16:25 +0000 |
commit | 018a8902c210c41ff8aa34f5515a6e44386c4461 (patch) | |
tree | 682cbe2be5aa645227ee90d80f0d6a5e24cbdff9 /baseboard/zork | |
parent | 715c464eb2600910e922e198a20ab7119bfb4a88 (diff) | |
download | chrome-ec-018a8902c210c41ff8aa34f5515a6e44386c4461.tar.gz |
zork: fix mux hpd_update crash
Zork does not guard calls to mux->hpd_update and this
is causing a crash when we call it on a driver that
does not support it.
BUG=none
BRANCH=none
TEST=disconnect external display and verify no crash
Change-Id: Id9fd91322f86ba965bdb71be4e0f870644928462
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1993658
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'baseboard/zork')
-rw-r--r-- | baseboard/zork/usb_pd_policy.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/baseboard/zork/usb_pd_policy.c b/baseboard/zork/usb_pd_policy.c index 1b7e5653df..fde96819c7 100644 --- a/baseboard/zork/usb_pd_policy.c +++ b/baseboard/zork/usb_pd_policy.c @@ -156,7 +156,9 @@ __override void svdm_dp_post_config(int port) /* set the minimum time delay (2ms) for the next HPD IRQ */ hpd_deadline[port] = get_time().val + HPD_USTREAM_DEBOUNCE_LVL; - mux->hpd_update(port, 1, 0); + + if (mux->hpd_update) + mux->hpd_update(port, 1, 0); } __override void svdm_exit_dp_mode(int port) @@ -169,6 +171,8 @@ __override void svdm_exit_dp_mode(int port) usb_mux_set(port, TYPEC_MUX_NONE, USB_SWITCH_CONNECT, pd_get_polarity(port)); gpio_set_level(PORT_TO_HPD(port), 0); - mux->hpd_update(port, 0, 0); + + if (mux->hpd_update) + mux->hpd_update(port, 0, 0); } #endif /* CONFIG_USB_PD_ALT_MODE_DFP */ |