fix cu3088 group write
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Guillaume Morin
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 =====
drivers/s390/net/cu3088.c Mon Aug 25 12:42:39 2003 renamed from drivers/s390/net/cu3088.c Mon May 26 02:00:00 2003 +1 -1
@@ -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;
Dans un message du 25 aoû à 12:47, Arnd Bergmann écrivait :
Quoted 3 lines
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.
Well, I did not know that BUS_ID_SIZE was including the trailing zero. The name does not appear to suggest that. BUS_ID_LEN would have been a better chose for that imho.
I don't know what you call "not right". My fix was the safest bet. It is right but yours is cleaner.
Signature · 3 lines
Guillaume Morin <[email protected]> Marry me girl, be my only fairy to the world (RHCP)
Quoted 2 lines · Guillaume Morin
I don't know what you call "not right". My fix was the safest bet. It is right but yours is cleaner.
Yes, I only meant that your version wasn't the way I wanted it, not that it was buggy like my original code.
Arnd <><