From 86266452f80545285c14e20a8024f79c4fb88a86 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Wed, 13 Jan 2010 15:33:15 +0100 Subject: USB: Push BKL on open down into the drivers Straightforward push into the drivers to allow auditing individual drivers separately Signed-off-by: Oliver Neukum Acked-by: Mauro Carvalho Chehab Cc: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/media/video/dabusb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/media/video') diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c index 9b413a3..0f50508 100644 --- a/drivers/media/video/dabusb.c +++ b/drivers/media/video/dabusb.c @@ -616,10 +616,12 @@ static int dabusb_open (struct inode *inode, struct file *file) { int devnum = iminor(inode); pdabusb_t s; + int r; if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB)) return -EIO; + lock_kernel(); s = &dabusb[devnum - DABUSB_MINOR]; dbg("dabusb_open"); @@ -634,6 +636,7 @@ static int dabusb_open (struct inode *inode, struct file *file) msleep_interruptible(500); if (signal_pending (current)) { + unlock_kernel(); return -EAGAIN; } mutex_lock(&s->mutex); @@ -641,6 +644,7 @@ static int dabusb_open (struct inode *inode, struct file *file) if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) { mutex_unlock(&s->mutex); dev_err(&s->usbdev->dev, "set_interface failed\n"); + unlock_kernel(); return -EINVAL; } s->opened = 1; @@ -649,7 +653,9 @@ static int dabusb_open (struct inode *inode, struct file *file) file->f_pos = 0; file->private_data = s; - return nonseekable_open(inode, file); + r = nonseekable_open(inode, file); + unlock_kernel(); + return r; } static int dabusb_release (struct inode *inode, struct file *file) -- cgit v1.1