bus: mhi: host: Release mhi_chan write lock on map_single fails

Release mhi_chan write lock before returning on map_single
callback failure.

Change-Id: Iab4bcc878ff5ed7d11c6e943f949ab39dc77b829
Signed-off-by: Vivek Pernamitta <quic_vpernami@quicinc.com>
Signed-off-by: Lazarus Motha <quic_lmotha@quicinc.com>
This commit is contained in:
Vivek Pernamitta 2021-12-29 15:17:30 +05:30 committed by Gerrit - the friendly Code Review server
parent 90fc13e213
commit e541397ebd

View File

@ -1300,8 +1300,10 @@ int mhi_gen_tre(struct mhi_controller *mhi_cntrl, struct mhi_chan *mhi_chan,
if (!info->pre_mapped) {
ret = mhi_cntrl->map_single(mhi_cntrl, buf_info);
if (ret)
if (ret) {
write_unlock_bh(&mhi_chan->lock);
return ret;
}
}
eob = !!(flags & MHI_EOB);