bus: mhi: core: Check state before processing power_down
authorJeffrey Hugo <jhugo@codeaurora.org>
Wed, 10 Mar 2021 20:49:25 +0000 (13:49 -0700)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tue, 16 Mar 2021 06:17:31 +0000 (11:47 +0530)
commit9e40641f62cd812b21f2c73b5cfb3346eb466dea
tree90f7acc88b71b4c5a3460bc0b2dfcfdb2e0f09f3
parent68731852f6e58d19f692971dc84deb64265f6d3f
bus: mhi: core: Check state before processing power_down

We cannot process a power_down if the power state is DISABLED.  There is
no valid mhi_ctxt in that case, so attepting to process the power_down
will likely result in a null pointer dereference.  If the power state is
DISABLED, there is nothing to do anyways, so just bail early.

Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/1615409365-8165-1-git-send-email-jhugo@codeaurora.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/bus/mhi/core/pm.c