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

Commit ea9e195f authored by Vivek Pernamitta's avatar Vivek Pernamitta Committed by Gerrit - the friendly Code Review server
Browse files

mhi: core: Add checks for bhie offsets



Return immediately if device returns an invalid BHIE offsets.

Change-Id: I2fd8fe73e47b28b1b212284c02e5c9c857805461
Signed-off-by: default avatarVivek Pernamitta <vpernami@codeaurora.org>
parent ac1e0fa5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1776,6 +1776,13 @@ int mhi_prepare_for_power_up(struct mhi_controller *mhi_cntrl)
				goto bhie_error;
			}

			if (bhie_off >= mhi_cntrl->len) {
				MHI_ERR("Invalid BHIE=0x%x  len=0x%x\n",
					bhie_off, mhi_cntrl->len);
				ret = -EINVAL;
				goto bhie_error;
			}

			mhi_cntrl->bhie = mhi_cntrl->regs + bhie_off;
		}