Add explicit lock_kernel() calls to printer_open()

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
Jonathan Corbet 2008-05-16 14:21:30 -06:00
Родитель 26ce4f0684
Коммит b2f2ba01b2
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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;
}