Re: [BUG/PATCH] : bug in tty_default_put_char()

From: Russell King (rmk@arm.linux.org.uk)
Date: Mon Aug 26 2002 - 14:31:26 EST


On Mon, Aug 26, 2002 at 11:07:49AM -0700, Jean Tourrilhes wrote:
> Bug : tty_default_put_char() doesn't check the return value of
> tty->driver.write(). However, the later may fail if buffers are full.

Hmm.

> Solution : It's not obvious what should be done. The attached
> patch is certainly wrong, but gives you an idea of what the problem
> is.

Every invocation of the put_char() method should be preceded by a check
to ensure that there is sufficient space in the drivers buffer (via the
drivers write_room() call.) Could you add a BUG() on this condition
and get some call traces please?

> I'll try to workaround that in IrCOMM.

I don't think that should be necessary. The tty layer is obviously
doing something it shouldn't (trying to stuff characters into a buffer
of zero size) so it should get fixed.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Aug 31 2002 - 22:00:18 EST