mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
HID: intel-thc-hid: Intel-quickspi: Fix some error codes
If we have a partial read that is supposed to be treated as failure but
in this code we forgot to set the error code. Return -EINVAL.
Fixes: 9d8d51735a ("HID: intel-thc-hid: intel-quickspi: Add HIDSPI protocol implementation")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Even Xu <even.xu@intel.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
3524900cc5
commit
ae4ac07733
|
|
@ -94,7 +94,7 @@ static int quickspi_get_device_descriptor(struct quickspi_device *qsdev)
|
|||
dev_err_once(qsdev->dev, "Read DEVICE_DESCRIPTOR failed, ret = %d\n", ret);
|
||||
dev_err_once(qsdev->dev, "DEVICE_DESCRIPTOR expected len = %u, actual read = %u\n",
|
||||
input_len, read_len);
|
||||
return ret;
|
||||
return ret ?: -EINVAL;
|
||||
}
|
||||
|
||||
input_rep_type = ((struct input_report_body_header *)read_buf)->input_report_type;
|
||||
|
|
@ -318,7 +318,7 @@ int reset_tic(struct quickspi_device *qsdev)
|
|||
dev_err_once(qsdev->dev, "Read RESET_RESPONSE body failed, ret = %d\n", ret);
|
||||
dev_err_once(qsdev->dev, "RESET_RESPONSE body expected len = %u, actual = %u\n",
|
||||
read_len, actual_read_len);
|
||||
return ret;
|
||||
return ret ?: -EINVAL;
|
||||
}
|
||||
|
||||
input_rep_type = FIELD_GET(HIDSPI_IN_REP_BDY_HDR_REP_TYPE, reset_response);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user