projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38b7f49
)
HID: fix memory leak on error path in debug code
author
Jiri Kosina
<jkosina@suse.cz>
Fri, 26 Jun 2009 08:50:12 +0000
(10:50 +0200)
committer
Jiri Kosina
<jkosina@suse.cz>
Fri, 26 Jun 2009 08:50:12 +0000
(10:50 +0200)
If hid_get_report() fails, we forgot to free the already allocated buffer
for debugging messages on error path. Fix that up.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-core.c
patch
|
blob
|
history
diff --git
a/drivers/hid/hid-core.c
b/drivers/hid/hid-core.c
index 449bd747d116e3bfe1d10cf8e5d17c4e8660961c..86c2ff2429d828db35df240329bcdfb7dc1331ee 100644
(file)
--- a/
drivers/hid/hid-core.c
+++ b/
drivers/hid/hid-core.c
@@
-1100,8
+1100,10
@@
int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
hid_debug_event(hid, buf);
report = hid_get_report(report_enum, data);
- if (!report)
+ if (!report) {
+ kfree(buf);
return -1;
+ }
/* dump the report */
snprintf(buf, HID_DEBUG_BUFSIZE - 1,