There is an error condition that's not reported to
the spi core in kp_spi_transfer_one_message().
It should restore status value to m->status, and
return it in error path.
Signed-off-by: Mao Wenan <maowenan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
list_for_each_entry(transfer, &m->transfers, transfer_list) {
if (transfer->tx_buf == NULL && transfer->rx_buf == NULL && transfer->len) {
status = -EINVAL;
- break;
+ goto error;
}
/* transfer */
if (count != transfer->len) {
status = -EIO;
- break;
+ goto error;
}
}
/* done work */
spi_finalize_current_message(master);
return 0;
+
+ error:
+ m->status = status;
+ return status;
}
static void