pd: never answer malformed VDM

When we are receiving a VDM which seems malformed, don't try to send an
answer, else we can ping-pong broken messages with the other side.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=none
TEST=plug Ryu P6 to plankton, no longer see endless "ERR:CMDT:1" error
messages.

Change-Id: If5b581c5c68996c60e37ac6d96638fd5df24356f
Reviewed-on: https://chromium-review.googlesource.com/273525
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vincent Palatin
2015-05-27 09:32:38 -07:00
committed by ChromeOS Commit Bot
parent a2075a5430
commit 245ee9f8d9

View File

@@ -726,6 +726,8 @@ int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload)
#endif /* CONFIG_USB_PD_ALT_MODE_DFP */
} else {
CPRINTF("ERR:CMDT:%d\n", cmd);
/* do not answer */
rsize = 0;
}
return rsize;
}