aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hidraw.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-04-26 18:56:08 -0400
committerJiri Kosina <jkosina@suse.cz>2012-04-27 14:10:09 -0400
commitb6787242f32700377d3da3b8d788ab3928bab849 (patch)
tree54428bcff5865df64980d0af4423d52b6c1dffa5 /include/linux/hidraw.h
parentd4f0e4daf0d867f80c78ca4f9ac03a562e229e72 (diff)
HID: hidraw: add proper error handling to raw event reporting
If kmemdup() in hidraw_report_event() fails, we are not propagating this fact properly. Let hidraw_report_event() and hid_report_raw_event() return an error value to the caller. Reported-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/hidraw.h')
-rw-r--r--include/linux/hidraw.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h
index 4b88e697c4e9..9cdc9b67ff49 100644
--- a/include/linux/hidraw.h
+++ b/include/linux/hidraw.h
@@ -76,13 +76,13 @@ struct hidraw_list {
76#ifdef CONFIG_HIDRAW 76#ifdef CONFIG_HIDRAW
77int hidraw_init(void); 77int hidraw_init(void);
78void hidraw_exit(void); 78void hidraw_exit(void);
79void hidraw_report_event(struct hid_device *, u8 *, int); 79int hidraw_report_event(struct hid_device *, u8 *, int);
80int hidraw_connect(struct hid_device *); 80int hidraw_connect(struct hid_device *);
81void hidraw_disconnect(struct hid_device *); 81void hidraw_disconnect(struct hid_device *);
82#else 82#else
83static inline int hidraw_init(void) { return 0; } 83static inline int hidraw_init(void) { return 0; }
84static inline void hidraw_exit(void) { } 84static inline void hidraw_exit(void) { }
85static inline void hidraw_report_event(struct hid_device *hid, u8 *data, int len) { } 85static inline int hidraw_report_event(struct hid_device *hid, u8 *data, int len) { }
86static inline int hidraw_connect(struct hid_device *hid) { return -1; } 86static inline int hidraw_connect(struct hid_device *hid) { return -1; }
87static inline void hidraw_disconnect(struct hid_device *hid) { } 87static inline void hidraw_disconnect(struct hid_device *hid) { }
88#endif 88#endif