提交 6710f773 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

USB: idmouse: drop redundant open-count check from release

The open count will always be exactly one when release is called, so
drop the redundant sanity check.
Signed-off-by: NJohan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191105103638.4929-3-johan@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 79c36a70
......@@ -278,12 +278,6 @@ static int idmouse_release(struct inode *inode, struct file *file)
/* lock our device */
mutex_lock(&dev->lock);
/* are we really open? */
if (dev->open <= 0) {
mutex_unlock(&dev->lock);
return -ENODEV;
}
--dev->open;
if (!dev->present) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册