[PATCH] dmaengine: ti: edma: Fix reference count leaks due to pm_runtime_get_sync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On calling pm_runtime_get_sync() the reference count of the device
is incremented. In case of failure, should decrement the reference
count before returning the error. So we fixed it by replacing it
with pm_runtime_resume_and_get.

Signed-off-by: Wang Xiaojun <wangxiaojun11@xxxxxxxxxx>
---
 drivers/dma/ti/edma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index 35d81bd857f1..38af8b596e1c 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -2399,7 +2399,7 @@ static int edma_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, ecc);
 
 	pm_runtime_enable(dev);
-	ret = pm_runtime_get_sync(dev);
+	ret = pm_runtime_resume_and_get(dev);
 	if (ret < 0) {
 		dev_err(dev, "pm_runtime_get_sync() failed\n");
 		pm_runtime_disable(dev);
-- 
2.25.1




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux