diff mbox series

[5/5] scsi: ufs: pltfrm: Dellocate HBA during ufshcd_pltfrm_remove()

Message ID 20241111-ufs_bug_fix-v1-5-45ad8b62f02e@linaro.org (mailing list archive)
State Not Applicable
Headers show
Series scsi: ufs: Bug fixes for ufs core and platform drivers | expand

Commit Message

Manivannan Sadhasivam via B4 Relay Nov. 11, 2024, 5:48 p.m. UTC
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

This will ensure that the scsi host is cleaned up properly using
scsi_host_dev_release(). Otherwise, it may lead to memory leaks.

Cc: stable@vger.kernel.org # 4.4
Fixes: 03b1781aa978 ("[SCSI] ufs: Add Platform glue driver for ufshcd")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/ufs/host/ufshcd-pltfrm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Peter Wang (王信友) Nov. 12, 2024, 2:20 a.m. UTC | #1
On Mon, 2024-11-11 at 23:18 +0530, Manivannan Sadhasivam via B4 Relay
wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> 
> This will ensure that the scsi host is cleaned up properly using
> scsi_host_dev_release(). Otherwise, it may lead to memory leaks.
> 
> Cc: stable@vger.kernel.org # 4.4
> Fixes: 03b1781aa978 ("[SCSI] ufs: Add Platform glue driver for
> ufshcd")
> Signed-off-by: Manivannan Sadhasivam <
> manivannan.sadhasivam@linaro.org>
> ---
>  drivers/ufs/host/ufshcd-pltfrm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 

Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Bean Huo Nov. 17, 2024, 6:46 p.m. UTC | #2
Reviewed-by: Bean Huo <beanhuo@micron.com>
diff mbox series

Patch

diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
index b8dadd0a2f4c..505572d4fa87 100644
--- a/drivers/ufs/host/ufshcd-pltfrm.c
+++ b/drivers/ufs/host/ufshcd-pltfrm.c
@@ -534,6 +534,7 @@  void ufshcd_pltfrm_remove(struct platform_device *pdev)
 
 	pm_runtime_get_sync(&pdev->dev);
 	ufshcd_remove(hba);
+	ufshcd_dealloc_host(hba);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_put_noidle(&pdev->dev);
 }