Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed653e0b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mhi: core: Add range check for channel id received in event ring"

parents a4ccb8fc 8b183772
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1195,6 +1195,10 @@ static void mhi_process_cmd_completion(struct mhi_controller *mhi_cntrl,
		break;
	default:
		chan = MHI_TRE_GET_CMD_CHID(cmd_pkt);
		if (chan >= mhi_cntrl->max_chan) {
			MHI_ERR("invalid channel id %u\n", chan);
			break;
		}
		mhi_chan = &mhi_cntrl->mhi_chan[chan];
		write_lock_bh(&mhi_chan->lock);
		mhi_chan->ccs = MHI_TRE_GET_EV_CODE(tre);