From 7a3b0b35d9771b4159e2bf39e84a710b08bca350 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 20 Feb 2008 20:47:56 +0000 Subject: [PATCH] --- yaml --- r: 93296 b: refs/heads/master c: 2097890c43a8fe90763f31b0010fd6963f5512c8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/serial/usb-serial.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 8e62c9844a94..ff0d8853a4b0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3d01f0fe6b66dd34511eaf35e06764b8997187bc +refs/heads/master: 2097890c43a8fe90763f31b0010fd6963f5512c8 diff --git a/trunk/drivers/usb/serial/usb-serial.c b/trunk/drivers/usb/serial/usb-serial.c index 2138ba8aeb69..aea861e9173e 100644 --- a/trunk/drivers/usb/serial/usb-serial.c +++ b/trunk/drivers/usb/serial/usb-serial.c @@ -401,11 +401,13 @@ static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned in struct usb_serial_port *port = tty->driver_data; int retval = -ENODEV; + lock_kernel(); 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; @@ -416,8 +418,8 @@ static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned in retval = port->serial->type->ioctl(port, file, cmd, arg); else retval = -ENOIOCTLCMD; - exit: + unlock_kernel(); return retval; } @@ -446,19 +448,24 @@ static void serial_break (struct tty_struct *tty, int break_state) { struct usb_serial_port *port = tty->driver_data; - if (!port) + lock_kernel(); + if (!port) { + unlock_kernel(); return; + } dbg("%s - port %d", __FUNCTION__, port->number); if (!port->open_count) { dbg("%s - port not open", __FUNCTION__); + unlock_kernel(); 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); + unlock_kernel(); } static int serial_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data)