]> err.no Git - linux-2.6/commitdiff
printer gadget: BKL pushdown
authorJonathan Corbet <corbet@lwn.net>
Fri, 16 May 2008 20:21:30 +0000 (14:21 -0600)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:52 +0000 (14:05 -0600)
Add explicit lock_kernel() calls to printer_open()

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
drivers/usb/gadget/printer.c

index 76be75e3ab8fe4a051240b8c37e7f15c8558edba..ec8f2eb041ca97b258e4ae3a45700b0305f6caf1 100644 (file)
@@ -462,6 +462,7 @@ printer_open(struct inode *inode, struct file *fd)
        unsigned long           flags;
        int                     ret = -EBUSY;
 
+       lock_kernel();
        dev = container_of(inode->i_cdev, struct printer_dev, printer_cdev);
 
        spin_lock_irqsave(&dev->lock, flags);
@@ -477,7 +478,7 @@ printer_open(struct inode *inode, struct file *fd)
        spin_unlock_irqrestore(&dev->lock, flags);
 
        DBG(dev, "printer_open returned %x\n", ret);
-
+       unlock_kernel();
        return ret;
 }