Merge "mhi: core: Read transfer length from an event properly"

This commit is contained in:
qctecmdr 2020-06-04 14:48:29 -07:00 committed by Gerrit - the friendly Code Review server
commit c2ac24a1a9

View File

@ -1070,7 +1070,9 @@ static int parse_rsc_event(struct mhi_controller *mhi_cntrl,
result.transaction_status = (ev_code == MHI_EV_CC_OVERFLOW) ?
-EOVERFLOW : 0;
result.bytes_xferd = xfer_len;
/* truncate to buf len if xfer_len is larger */
result.bytes_xferd = min_t(u16, xfer_len, buf_info->len);
result.buf_addr = buf_info->cb_buf;
result.dir = mhi_chan->dir;