lp: too large subtraction on unsigned?

From: Roel Kluin
Date: Sun Mar 01 2009 - 17:56:48 EST


vi drivers/char/lp.c +705

note that count is unsigned, and we do the loop:

do {
if (canwrite > 0) {
...
count -= written;
}
if (lf && canwrite <= 0) {
...
count--;
...
}
} while (count > 0 && (CONSOLE_LP_STRICT || written > 0));

Isn't this wrong?

Roel
--
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/