From 647ac36fda37a8ec6dd0371ab0f1e4d9780bead8 Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Fri, 17 Oct 2014 16:10:48 -0700 Subject: pd: do not respond to unknown SVDMs bug fix: if we see an unknown SVDM, do not respond to it. BUG=none BRANCH=samus TEST=test with third party that sends unknown SVDM Change-Id: I3ef6c38be029d57bf3784ba832b7ae137f379049 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/224179 Reviewed-by: Vincent Palatin --- common/usb_pd_policy.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common/usb_pd_policy.c') diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index 2738a2f254..5aa4c6cb24 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -263,6 +263,8 @@ int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload) case CMD_EXIT_MODE: rsize = pd_exit_mode(port, payload); break; + default: + rsize = 0; } payload[0] &= ~VDO_CMDT(0); payload[0] |= VDO_CMDT(CMDT_INIT); @@ -284,6 +286,8 @@ int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload) case CMD_EXIT_MODE: rsize = 0; break; + default: + rsize = 0; } } else if (cmd_type == CMDT_RSP_NAK) { /* nothing to do */ -- cgit v1.2.1