From: Oliver Neukum <oliver@neukum.org>
To: Jiri Kosina <jkosina@suse.cz>, Jiri Slaby <jirislaby@gmail.com>,
linux-input@vger.kernel.org
Subject: [patch for 2.6.28]open refcount issue in hidraw
Date: Mon, 15 Dec 2008 13:04:45 +0100 [thread overview]
Message-ID: <200812151304.45996.oliver@neukum.org> (raw)
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>
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.
---
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 7685ae6..96ec1ba 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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2008-12-15 12:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-15 12:04 Oliver Neukum [this message]
2008-12-15 12:13 ` [patch for 2.6.28]open refcount issue in hidraw Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200812151304.45996.oliver@neukum.org \
--to=oliver@neukum.org \
--cc=jirislaby@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).