summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2008-12-15 13:12:08 +0100
committerJiri Kosina <jkosina@suse.cz>2009-01-04 01:01:43 +0100
commitb8a832b1c0a70531b4bd69a67aa0bf72f6f2dc34 (patch)
tree61ff346a6b1381d7d2e1cba33902fe3f5fe1c91c /drivers/hid
parent25e61613cf3ca7f6d5f89a707b20c9eed6b74455 (diff)
downloadlinux-3.10-b8a832b1c0a70531b4bd69a67aa0bf72f6f2dc34.tar.gz
linux-3.10-b8a832b1c0a70531b4bd69a67aa0bf72f6f2dc34.tar.bz2
linux-3.10-b8a832b1c0a70531b4bd69a67aa0bf72f6f2dc34.zip
HID: fix reference count leak hidraw
The hidraw subsystem has a bug that prevents the close syscall from ever reaching the low level driver, leading to a resource leak. Fix by replacing postdecrement with predecrement. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hidraw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 7685ae6808c..96ec1bacbbf 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -208,7 +208,7 @@ static int hidraw_release(struct inode * inode, struct file * file)
list_del(&list->node);
dev = hidraw_table[minor];
- if (!dev->open--) {
+ if (!--dev->open) {
if (list->hidraw->exist)
dev->hid->ll_driver->close(dev->hid);
else