Commit b2f2ba01 authored by Jonathan Corbet's avatar Jonathan Corbet

printer gadget: BKL pushdown

Add explicit lock_kernel() calls to printer_open()
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 26ce4f06
...@@ -462,6 +462,7 @@ printer_open(struct inode *inode, struct file *fd) ...@@ -462,6 +462,7 @@ printer_open(struct inode *inode, struct file *fd)
unsigned long flags; unsigned long flags;
int ret = -EBUSY; int ret = -EBUSY;
lock_kernel();
dev = container_of(inode->i_cdev, struct printer_dev, printer_cdev); dev = container_of(inode->i_cdev, struct printer_dev, printer_cdev);
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
...@@ -477,7 +478,7 @@ printer_open(struct inode *inode, struct file *fd) ...@@ -477,7 +478,7 @@ printer_open(struct inode *inode, struct file *fd)
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
DBG(dev, "printer_open returned %x\n", ret); DBG(dev, "printer_open returned %x\n", ret);
unlock_kernel();
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment