projects
/
deliverable
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9561f7f
)
HID: hidraw: open count should not increase if error
author
Amit Nagal
<helloin.amit@gmail.com>
Tue, 27 Sep 2011 17:41:58 +0000
(13:41 -0400)
committer
Jiri Kosina
<jkosina@suse.cz>
Tue, 27 Sep 2011 16:42:22 +0000
(18:42 +0200)
In hidraw_open, if hid_hw_power returns with error, hidraw device open count
should not increase.
Signed-off-by: Amit Nagal <helloin.amit@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hidraw.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/hid/hidraw.c
b/drivers/hid/hidraw.c
index a8c2b7b6220a8316a159a263a426ee6360fd58a3..6d65d4e35120689ea8dd39827c12ed825060af42 100644
(file)
--- a/
drivers/hid/hidraw.c
+++ b/
drivers/hid/hidraw.c
@@
-272,8
+272,10
@@
static int hidraw_open(struct inode *inode, struct file *file)
dev = hidraw_table[minor];
if (!dev->open++) {
err = hid_hw_power(dev->hid, PM_HINT_FULLON);
- if (err < 0)
+ if (err < 0) {
+ dev->open--;
goto out_unlock;
+ }
err = hid_hw_open(dev->hid);
if (err < 0) {
This page took
0.02459 seconds
and
5
git commands to generate.