From: Luiz Fernando Capitulino Date: Mon, 28 Nov 2005 21:16:07 +0000 (-0200) Subject: [PATCH] USB: usbserial: race-condition fix. X-Git-Tag: v2.6.16-rc1~474^2~22^2~10^2~41 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a4613f01f5bb850cab34e3db572d97251d997b3;p=pandora-kernel.git [PATCH] USB: usbserial: race-condition fix. There is a race-condition in usb-serial driver that can be triggered if a processes does 'port->tty->driver_data = NULL' in serial_close() while other processes is in kernel-space about to call serial_ioctl() on the same port. This happens because a process can open the device while there is another one closing it. The patch below fixes that by adding a semaphore to ensure that no process will open the device while another process is closing it. Note that we can't use spinlocks here, since serial_open() and serial_close() can sleep. Signed-off-by: Luiz Capitulino Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed