Skip to content
Commit 94d4e7af authored by Enrico Granata's avatar Enrico Granata Committed by Enric Balletbo i Serra
Browse files

platform/chrome: cros_ec_proto: check for NULL transfer function



As new transfer mechanisms are added to the EC codebase, they may
not support v2 of the EC protocol.

If the v3 initial handshake transfer fails, the kernel will try
and call cmd_xfer as a fallback. If v2 is not supported, cmd_xfer
will be NULL, and the code will end up causing a kernel panic.

Add a check for NULL before calling the transfer function, along
with a helpful comment explaining how one might end up in this
situation.

Signed-off-by: default avatarEnrico Granata <egranata@chromium.org>
Reviewed-by: default avatarJett Rink <jettrink@chromium.org>
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
parent a2679b64
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment