Skip to content

Commit

Permalink
printer gadget: BKL pushdown
Browse files Browse the repository at this point in the history
Add explicit lock_kernel() calls to printer_open()

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent 26ce4f0 commit b2f2ba0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/gadget/printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit b2f2ba0

Please sign in to comment.