Re: [PATCH resend #1] fix cu3088 group write

From: Arnd Bergmann
Date: Tue Aug 26 2003 - 13:07:51 EST


Guillaume Morin wrote:

> Hi Linus, Andrew
>
> The current cu3088 ccwgroup write code overwrite the last char of the
> given arguments. This following patch fixes the problem. It is been
> tested and applies on latest bk.

Your fix doesn't look right either. The input string should not
be longer than BUS_ID_SIZE, including the trailing zero.
AFAICS, the correct way to solve this is the patch below,
but I did not test it. Thanks for reporting the problem.

Arnd <><

===== drivers/s390/net/cu3088.c 1.5 vs edited =====
--- 1.5/drivers/s390/net/cu3088.c Mon May 26 02:00:00 2003
+++ edited/drivers/s390/net/cu3088.c Mon Aug 25 12:42:39 2003
@@ -79,7 +79,7 @@

if (!(end = strchr(start, delim[i])))
return count;
- len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start);
+ len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1);
strlcpy (bus_ids[i], start, len);
argv[i] = bus_ids[i];
start = end + 1;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/