[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201228125028.151067722@linuxfoundation.org>
Date: Mon, 28 Dec 2020 13:42:28 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Shuah Khan <skhan@...uxfoundation.org>,
Bhaumik Bhatt <bbhatt@...eaurora.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.10 150/717] bus: mhi: core: Remove double locking from mhi_driver_remove()
From: Bhaumik Bhatt <bbhatt@...eaurora.org>
[ Upstream commit 9b627c25e70816a5e1dca940444b5029065b4d60 ]
There is double acquisition of the pm_lock from mhi_driver_remove()
function. Remove the read_lock_bh/read_unlock_bh calls for pm_lock
taken during a call to mhi_device_put() as the lock is acquired
within the function already. This will help avoid a potential
kernel panic.
Fixes: 189ff97cca53 ("bus: mhi: core: Add support for data transfer")
Reported-by: Shuah Khan <skhan@...uxfoundation.org>
Signed-off-by: Bhaumik Bhatt <bbhatt@...eaurora.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/bus/mhi/core/init.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
index 0ffdebde82657..0a09f8215057d 100644
--- a/drivers/bus/mhi/core/init.c
+++ b/drivers/bus/mhi/core/init.c
@@ -1276,10 +1276,8 @@ static int mhi_driver_remove(struct device *dev)
mutex_unlock(&mhi_chan->mutex);
}
- read_lock_bh(&mhi_cntrl->pm_lock);
while (mhi_dev->dev_wake)
mhi_device_put(mhi_dev);
- read_unlock_bh(&mhi_cntrl->pm_lock);
return 0;
}
--
2.27.0
Powered by blists - more mailing lists