Calculating size of the report as sizeof(pointer) always passess the length
corresponding to the pointer type, not the underlying data report.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
input[7] = check_sum;
ret = hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, input,
input[7] = check_sum;
ret = hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, input,
- sizeof(input), HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
+ sizeof(u8)*U1_FEATURE_REPORT_LEN, HID_FEATURE_REPORT,
+ HID_REQ_SET_REPORT);
if (ret < 0) {
dev_err(&hdev->dev, "failed to read command (%d)\n", ret);
if (ret < 0) {
dev_err(&hdev->dev, "failed to read command (%d)\n", ret);
if (read_flag) {
ret = hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, readbuf,
if (read_flag) {
ret = hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, readbuf,
- sizeof(readbuf), HID_FEATURE_REPORT,
- HID_REQ_GET_REPORT);
+ sizeof(u8)*U1_FEATURE_REPORT_LEN,
+ HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
if (ret < 0) {
dev_err(&hdev->dev, "failed read register (%d)\n", ret);
if (ret < 0) {
dev_err(&hdev->dev, "failed read register (%d)\n", ret);