Skip to content

Commit

Permalink
HID: fix reference count leak hidraw
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oliver Neukum authored and Jiri Kosina committed Jan 4, 2009
1 parent 25e6161 commit b8a832b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b8a832b

Please sign in to comment.