mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 05:31:15 +00:00
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>
This commit is contained in:
parent
d4f0e4daf0
commit
b6787242f3
4 changed files with 27 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue