]> git.sur5r.net Git - u-boot/commitdiff
km/ivm: fix string len check to support 7 char board names
authorValentin Longchamp <valentin.longchamp@keymile.com>
Tue, 14 Aug 2012 01:16:36 +0000 (01:16 +0000)
committerPrafulla Wadaskar <prafulla@marvell.com>
Mon, 3 Sep 2012 12:02:58 +0000 (17:32 +0530)
The fanless boards now have a 7-digit (XXXXX-F) board name. This
triggers a border condition when reading this string in the IVM although
this string is smaller than the currenly read string size, but only by 1
character.

This patch corrects this by changing the size check condition for string
length. It is the same change that was done in the platform for this
same bug.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
cc: Stefan Bigler <stefan.bigler@keymile.com>

board/keymile/common/ivm.c

index 9bc3c21c9c64f99d5ed3d9283b83d9791d24d0e4..eaa924f0e6a6aae6dc5706db1f38e4cf7c058848 100644 (file)
@@ -163,7 +163,7 @@ static int ivm_findinventorystring(int type,
                if (addr == INVENTORYDATASIZE) {
                        xcode = -1;
                        printf("Error end of string not found\n");
-               } else if ((size >= (maxlen - 1)) &&
+               } else if ((size > (maxlen - 1)) &&
                           (buf[addr] != '\r')) {
                        xcode = -1;
                        printf("string too long till next CR\n");