HID: hidraw: add proper error handling to raw event reporting
authorJiri Kosina <jkosina@suse.cz>
Thu, 26 Apr 2012 22:56:08 +0000 (00:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Apr 2014 13:44:18 +0000 (06:44 -0700)
commit588256df90f26647828489e45d82b72e97d624e9
treefe26d74d69c752d9d173a0ce523d5416bf2c6ec2
parentf11c6f07cb7d33abb503e87909aba80c8605d141
HID: hidraw: add proper error handling to raw event reporting

commit b6787242f32700377d3da3b8d788ab3928bab849 upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-core.c
drivers/hid/hidraw.c
include/linux/hid.h
include/linux/hidraw.h