diff mbox series

[2/3] USB: idmouse: drop redundant open-count check from release

Message ID 20191105103638.4929-3-johan@kernel.org (mailing list archive)
State Mainlined
Commit 6710f773b51f21ad7d10198ca6424bea7faaf9d4
Headers show
Series USB: idmouse: disconnect clean ups | expand

Commit Message

Johan Hovold Nov. 5, 2019, 10:36 a.m. UTC
The open count will always be exactly one when release is called, so
drop the redundant sanity check.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/misc/idmouse.c | 6 ------
 1 file changed, 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c
index 0386bac224c4..9b9d5df829d5 100644
--- a/drivers/usb/misc/idmouse.c
+++ b/drivers/usb/misc/idmouse.c
@@ -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) {