Re: [PATCH] Memory leak in visor.c and ftdi_sio.c

From: Ian Abbott
Date: Mon Jun 07 2004 - 04:59:12 EST


On 05/06/2004 01:18, Greg KH wrote:
On Fri, Jun 04, 2004 at 05:34:41PM +0100, Ian Abbott wrote:
A related problem with the current implementation is that is easy to run out of memory by running something similar to this:

# cat /dev/zero > /dev/ttyUSB0

That affects both the ftdi_sio and visor drivers.


Care to try out the following (build test only) patch to the visor
driver to see if it prevents this from happening? I don't have a
working visor right now to test it out myself :(

I could try something similar on ftdi_sio, but am a bit pushed for time right now.

One comment about the test patch in case it turns into a real patch: I think it would be better to check the number of outstanding write urbs in visor_write_room instead of visor_write, otherwise some stuff written by the TTY line discipline will go missing.

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@xxxxxxxxx> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-

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