mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
printer gadget: BKL pushdown
Add explicit lock_kernel() calls to printer_open() Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
26ce4f0684
commit
b2f2ba01b2
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user