]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd: i2c: fix coverity issue
authorHeiko Schocher <hs@denx.de>
Mon, 4 Aug 2025 09:43:29 +0000 (11:43 +0200)
committerHeiko Schocher <hs@denx.de>
Wed, 6 Aug 2025 05:49:13 +0000 (07:49 +0200)
coverity scan reported issue:
** CID 583415:       Integer handling issues  (INTEGER_OVERFLOW)
/cmd/i2c.c: 369           in do_i2c_write()

change the length variable into type int.

Signed-off-by: Heiko Schocher <hs@denx.de>
cmd/i2c.c

index f0aae93073fa8129c282dce328d71515f9bb8609..e021067e68ab76d79a281e84bf52db27e2b039d0 100644 (file)
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -299,7 +299,8 @@ static int do_i2c_write(struct cmd_tbl *cmdtp, int flag, int argc,
                        char *const argv[])
 {
        uint    chip;
-       uint    devaddr, length;
+       uint    devaddr;
+       int length;
        int alen;
        u_char  *memaddr;
        int ret;