From b6787242f32700377d3da3b8d788ab3928bab849 Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Fri, 27 Apr 2012 00:56:08 +0200 Subject: 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 Signed-off-by: Jiri Kosina --- include/linux/hidraw.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux/hidraw.h') 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 { #ifdef CONFIG_HIDRAW int hidraw_init(void); void hidraw_exit(void); -void hidraw_report_event(struct hid_device *, u8 *, int); +int hidraw_report_event(struct hid_device *, u8 *, int); int hidraw_connect(struct hid_device *); void hidraw_disconnect(struct hid_device *); #else static inline int hidraw_init(void) { return 0; } static inline void hidraw_exit(void) { } -static inline void hidraw_report_event(struct hid_device *hid, u8 *data, int len) { } +static inline int hidraw_report_event(struct hid_device *hid, u8 *data, int len) { } static inline int hidraw_connect(struct hid_device *hid) { return -1; } static inline void hidraw_disconnect(struct hid_device *hid) { } #endif -- cgit v1.2.3-59-g8ed1b