Message ID | 20220609084957.3684698-10-tzungbi@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 878c36f6caa45d6a6234465fb16da07fc639f51d |
Headers | show |
Series | platform/chrome: Kunit tests and refactor for cros_ec_query_all() | expand |
diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c index 893b76703da6..6f5be9e5ede4 100644 --- a/drivers/platform/chrome/cros_ec_proto.c +++ b/drivers/platform/chrome/cros_ec_proto.c @@ -314,6 +314,11 @@ static int cros_ec_get_proto_info(struct cros_ec_device *ec_dev, int devidx) goto exit; } + if (ret == 0) { + ret = -EPROTO; + goto exit; + } + info = (struct ec_response_get_protocol_info *)msg->data; switch (devidx) {