[v4,2/6] bus: mhi: core: Set BHI and BHIe pointers to NULL in clean-up

Message ID 1620329545-32328-3-git-send-email-bbhatt@qti.qualcomm.com
State New
Headers show
  • BHI/BHIe improvements for MHI power purposes
Related show

Commit Message

Bhaumik Bhatt May 6, 2021, 7:32 p.m.
From: Bhaumik Bhatt <bbhatt@codeaurora.org>

Set the BHI and BHIe pointers to NULL as part of clean-up. This
makes sure that stale pointers are not accessed after powering
MHI down.

Suggested-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
 drivers/bus/mhi/core/init.c | 3 +++
 1 file changed, 3 insertions(+)


diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
index 11c7a3d..1cc2f22 100644
--- a/drivers/bus/mhi/core/init.c
+++ b/drivers/bus/mhi/core/init.c
@@ -1132,6 +1132,9 @@  void mhi_unprepare_after_power_down(struct mhi_controller *mhi_cntrl)
 		mhi_cntrl->rddm_image = NULL;
+	mhi_cntrl->bhi = NULL;
+	mhi_cntrl->bhie = NULL;