From 3e0d1c8b21faa87f595b1a691493e657de3505fa Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Mon, 17 Aug 2020 13:27:42 -0700 Subject: [PATCH] mhi: core: Set bhi and bhie to NULL upon power down Set the bhi and bhie pointers to NULL as part of clean up. This makes sure that stale pointers are not accessed in case the bhi or bhie is failed to initialize during power up. Change-Id: Iddbd3a8234ff4d384ab03081479d55faf10d9443 Signed-off-by: Hemant Kumar --- drivers/bus/mhi/core/mhi_pm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/bus/mhi/core/mhi_pm.c b/drivers/bus/mhi/core/mhi_pm.c index 74548ba2716d..61477d823742 100644 --- a/drivers/bus/mhi/core/mhi_pm.c +++ b/drivers/bus/mhi/core/mhi_pm.c @@ -1114,6 +1114,10 @@ void mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful) } mhi_deinit_dev_ctxt(mhi_cntrl); } + + /* reset set bhi and bhie to prevent reg access */ + mhi_cntrl->bhi = NULL; + mhi_cntrl->bhie = NULL; } EXPORT_SYMBOL(mhi_power_down);