]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
HID: fix reference count leak hidraw
authorOliver Neukum <oliver@neukum.org>
Mon, 15 Dec 2008 12:12:08 +0000 (13:12 +0100)
committerJiri Kosina <jkosina@suse.cz>
Sun, 4 Jan 2009 00:01:43 +0000 (01:01 +0100)
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>
drivers/hid/hidraw.c

index 7685ae6808c4d056ff00c8c33ebe544bb4e09167..96ec1bacbbf38449e9d95696b7797b8e81844862 100644 (file)
@@ -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