From: Oliver Neukum Date: Mon, 15 Dec 2008 12:12:08 +0000 (+0100) Subject: HID: fix reference count leak hidraw X-Git-Tag: v2.6.29-rc1~498^2^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b8a832b1c0a70531b4bd69a67aa0bf72f6f2dc34;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Jiri Kosina --- 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