diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/hid.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 09fbbd7fb784..60f3ff762376 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -989,6 +989,9 @@ static inline int hid_hw_raw_request(struct hid_device *hdev, | |||
| 989 | unsigned char reportnum, __u8 *buf, | 989 | unsigned char reportnum, __u8 *buf, |
| 990 | size_t len, unsigned char rtype, int reqtype) | 990 | size_t len, unsigned char rtype, int reqtype) |
| 991 | { | 991 | { |
| 992 | if (len < 1 || len > HID_MAX_BUFFER_SIZE || !buf) | ||
| 993 | return -EINVAL; | ||
| 994 | |||
| 992 | if (hdev->ll_driver->raw_request) | 995 | if (hdev->ll_driver->raw_request) |
| 993 | return hdev->ll_driver->raw_request(hdev, reportnum, buf, len, | 996 | return hdev->ll_driver->raw_request(hdev, reportnum, buf, len, |
| 994 | rtype, reqtype); | 997 | rtype, reqtype); |
| @@ -1008,6 +1011,9 @@ static inline int hid_hw_raw_request(struct hid_device *hdev, | |||
| 1008 | static inline int hid_hw_output_report(struct hid_device *hdev, __u8 *buf, | 1011 | static inline int hid_hw_output_report(struct hid_device *hdev, __u8 *buf, |
| 1009 | size_t len) | 1012 | size_t len) |
| 1010 | { | 1013 | { |
| 1014 | if (len < 1 || len > HID_MAX_BUFFER_SIZE || !buf) | ||
| 1015 | return -EINVAL; | ||
| 1016 | |||
| 1011 | if (hdev->ll_driver->output_report) | 1017 | if (hdev->ll_driver->output_report) |
| 1012 | return hdev->ll_driver->output_report(hdev, buf, len); | 1018 | return hdev->ll_driver->output_report(hdev, buf, len); |
| 1013 | 1019 | ||
