]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform/chrome: cros_ec_lightbar: Fix response size initialization
authorTzung-Bi Shih <tzungbi@kernel.org>
Fri, 30 Jan 2026 04:03:35 +0000 (04:03 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Fri, 30 Jan 2026 07:56:08 +0000 (07:56 +0000)
Commit 1e7913ff5f9f ("platform/chrome: cros_ec_lightbar: Reduce
ligthbar get version command") meant to set smaller values for both
request and response sizes.

However, it incorrectly assigned the response size to the `result` field
instead of `insize`.  Fix it.

Reported-by: Gwendal Grignou <gwendal@google.com>
Closes: https://lore.kernel.org/chrome-platform/CAMHSBOVrrYaB=1nEqZk09VkczCrj=6B-P8Fe29TpPdSDgT2CCQ@mail.gmail.com
Fixes: 1e7913ff5f9f ("platform/chrome: cros_ec_lightbar: Reduce ligthbar get version command")
Link: https://lore.kernel.org/r/20260130040335.361997-1-tzungbi@kernel.org
Reviewed-by: Gwendal Grignou <gwendal@google.com>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_ec_lightbar.c

index 8352e97327911fc5e03ad90867d107b179f53634..3702baff5d4f17a52da650cad9b250376ff974ac 100644 (file)
@@ -126,7 +126,7 @@ static int get_lightbar_version(struct cros_ec_dev *ec,
        param = (struct ec_params_lightbar *)msg->data;
        param->cmd = LIGHTBAR_CMD_VERSION;
        msg->outsize = sizeof(param->cmd);
-       msg->result = sizeof(resp->version);
+       msg->insize = sizeof(resp->version);
        ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg);
        if (ret < 0 && ret != -EINVAL) {
                ret = 0;