]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
platform/olpc: olpc-xo175-ec: Fix overflow error message to print inlen
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Tue, 10 Mar 2026 13:01:35 +0000 (06:01 -0700)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 23 Mar 2026 12:49:00 +0000 (14:49 +0200)
The command length check validates inlen (> 5), but the error message
incorrectly printed resp_len. Print inlen so the log reflects the
actual command length.

Fixes: 0c3d931b3ab9e ("Platform: OLPC: Add XO-1.75 EC driver")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Acked-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://patch.msgid.link/20260310130138.700687-1-alok.a.tiwari@oracle.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/olpc/olpc-xo175-ec.c

index fa7b3bda688a63ce5b405db21d6658d7e0dd1a65..bee271a4fda1a98cef06b82bbd5da9efd7677cef 100644 (file)
@@ -482,7 +482,7 @@ static int olpc_xo175_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *resp,
        dev_dbg(dev, "CMD %x, %zd bytes expected\n", cmd, resp_len);
 
        if (inlen > 5) {
-               dev_err(dev, "command len %zd too big!\n", resp_len);
+               dev_err(dev, "command len %zd too big!\n", inlen);
                return -EOVERFLOW;
        }