Take the lock in usb-serial instead. As it relies on the BKL internally
we can't push it any deeper yet.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
struct usb_serial_port *port = tty->driver_data;
int retval = -ENODEV;
struct usb_serial_port *port = tty->driver_data;
int retval = -ENODEV;
if (!port)
goto exit;
dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);
if (!port)
goto exit;
dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);
+ /* Caution - port->open_count is BKL protected */
if (!port->open_count) {
dbg ("%s - port not open", __FUNCTION__);
goto exit;
if (!port->open_count) {
dbg ("%s - port not open", __FUNCTION__);
goto exit;
retval = port->serial->type->ioctl(port, file, cmd, arg);
else
retval = -ENOIOCTLCMD;
retval = port->serial->type->ioctl(port, file, cmd, arg);
else
retval = -ENOIOCTLCMD;
{
struct usb_serial_port *port = tty->driver_data;
{
struct usb_serial_port *port = tty->driver_data;
+ lock_kernel();
+ if (!port) {
+ unlock_kernel();
dbg("%s - port %d", __FUNCTION__, port->number);
if (!port->open_count) {
dbg("%s - port not open", __FUNCTION__);
dbg("%s - port %d", __FUNCTION__, port->number);
if (!port->open_count) {
dbg("%s - port not open", __FUNCTION__);
return;
}
/* pass on to the driver specific version of this function if it is available */
if (port->serial->type->break_ctl)
port->serial->type->break_ctl(port, break_state);
return;
}
/* pass on to the driver specific version of this function if it is available */
if (port->serial->type->break_ctl)
port->serial->type->break_ctl(port, break_state);
}
static int serial_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data)
}
static int serial_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data)