All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.4 01/26] dmaengine: zynqmp_dma: Fix PM reference leak in zynqmp_dma_alloc_chan_resourc()
@ 2021-06-21 17:53 ` Sasha Levin
  0 siblings, 0 replies; 37+ messages in thread
From: Sasha Levin @ 2021-06-21 17:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Yu Kuai, Hulk Robot, Vinod Koul, Sasha Levin, dmaengine,
	linux-arm-kernel

From: Yu Kuai <yukuai3@huawei.com>

[ Upstream commit 8982d48af36d2562c0f904736b0fc80efc9f2532 ]

pm_runtime_get_sync will increment pm usage counter even it failed.
Forgetting to putting operation will result in reference leak here.
Fix it by replacing it with pm_runtime_resume_and_get to keep usage
counter balanced.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20210517081826.1564698-4-yukuai3@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/dma/xilinx/zynqmp_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index d47749a35863..84009c5e0f33 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -467,7 +467,7 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
 	struct zynqmp_dma_desc_sw *desc;
 	int i, ret;
 
-	ret = pm_runtime_get_sync(chan->dev);
+	ret = pm_runtime_resume_and_get(chan->dev);
 	if (ret < 0)
 		return ret;
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2021-06-21 18:12 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 17:53 [PATCH AUTOSEL 5.4 01/26] dmaengine: zynqmp_dma: Fix PM reference leak in zynqmp_dma_alloc_chan_resourc() Sasha Levin
2021-06-21 17:53 ` Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 02/26] mac80211: remove warning in ieee80211_get_sband() Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 03/26] mac80211_hwsim: drop pending frames on stop Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 04/26] cfg80211: call cfg80211_leave_ocb when switching away from OCB Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 05/26] dmaengine: rcar-dmac: Fix PM reference leak in rcar_dmac_probe() Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 06/26] dmaengine: mediatek: free the proper desc in desc_free handler Sasha Levin
2021-06-21 17:53   ` Sasha Levin
2021-06-21 17:53   ` Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 07/26] dmaengine: mediatek: do not issue a new desc if one is still current Sasha Levin
2021-06-21 17:53   ` Sasha Levin
2021-06-21 17:53   ` Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 08/26] dmaengine: mediatek: use GFP_NOWAIT instead of GFP_ATOMIC in prep_dma Sasha Levin
2021-06-21 17:53   ` Sasha Levin
2021-06-21 17:53   ` Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 09/26] net: ipv4: Remove unneed BUG() function Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 10/26] mac80211: drop multicast fragments Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 11/26] net: ethtool: clear heap allocations for ethtool function Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 12/26] ping: Check return value of function 'ping_queue_rcv_skb' Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 13/26] inet: annotate date races around sk->sk_txhash Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 14/26] net: phy: dp83867: perform soft reset and retain established link Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 15/26] net: caif: fix memory leak in ldisc_open Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 16/26] net/packet: annotate accesses to po->bind Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 17/26] net/packet: annotate accesses to po->ifindex Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 18/26] r8152: Avoid memcpy() over-reading of ETH_SS_STATS Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 19/26] sh_eth: " Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 20/26] r8169: " Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 21/26] KVM: selftests: Fix kvm_check_cap() assertion Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 22/26] net: qed: Fix memcpy() overflow of qed_dcbx_params() Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 23/26] recordmcount: Correct st_shndx handling Sasha Levin
2021-06-21 17:53   ` Sasha Levin
2021-06-21 17:53   ` Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 24/26] PCI: Add AMD RS690 quirk to enable 64-bit DMA Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 25/26] net: ll_temac: Add memory-barriers for TX BD access Sasha Levin
2021-06-21 17:53   ` Sasha Levin
2021-06-21 17:53 ` [PATCH AUTOSEL 5.4 26/26] net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY Sasha Levin
2021-06-21 17:53   ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.