open refcount issue in hidraw
PATCH 1/1 open refcount issue in 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.
Hi Jiři,
I found this testing hid autosuspend, but it is absolutely independent from it. In fact it seems to me that it should still go into 2.6.28 despite the lateness and should definitely go into the stable series. Hence I am sending this as a separate patch.
---
drivers/hid/hidraw.c +1 -1
@@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 3 lines · Oliver Neukum
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.
Good catch, applied, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs