linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDMA/hns: Fix missing put_device call in hns_roce_get_cfg
@ 2022-01-10  6:12 Miaoqian Lin
  2022-01-10  7:44 ` Leon Romanovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Miaoqian Lin @ 2022-01-10  6:12 UTC (permalink / raw)
  Cc: linmq006, Wenpeng Liang, Weihang Li, Jason Gunthorpe,
	Wei Hu(Xavier),
	Shaobo Xu, Doug Ledford, Lijun Ou, linux-rdma, linux-kernel

The reference taken by 'of_find_device_by_node()' must be released when
not needed anymore. And hns_roce_find_pdev() calls
bus_find_device_by_fwnode(), which calls bus_find_device().
We also need to drop the reference taken by bus_find_device.

Fixes: 08805fdbeb2d ("RDMA/hns: Split hw v1 driver from hns roce driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index f4af3992ba95..1bffeba55304 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -4545,6 +4545,7 @@ static int hns_roce_get_cfg(struct hns_roce_dev *hr_dev)
 				hr_dev->iboe.netdevs[port_cnt] = netdev;
 				hr_dev->iboe.phy_port[port_cnt] = phy_port;
 			} else {
+				put_device(&pdev->dev);
 				dev_err(dev, "no netdev found with pdev %s\n",
 					pdev->name);
 				return -ENODEV;
-- 
2.17.1


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

* Re: [PATCH] RDMA/hns: Fix missing put_device call in hns_roce_get_cfg
  2022-01-10  6:12 [PATCH] RDMA/hns: Fix missing put_device call in hns_roce_get_cfg Miaoqian Lin
@ 2022-01-10  7:44 ` Leon Romanovsky
  2022-01-10  8:23   ` Miaoqian Lin
  0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2022-01-10  7:44 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Wenpeng Liang, Weihang Li, Jason Gunthorpe, Wei Hu(Xavier),
	Shaobo Xu, Doug Ledford, Lijun Ou, linux-rdma, linux-kernel

On Mon, Jan 10, 2022 at 06:12:34AM +0000, Miaoqian Lin wrote:
> The reference taken by 'of_find_device_by_node()' must be released when
> not needed anymore. And hns_roce_find_pdev() calls
> bus_find_device_by_fwnode(), which calls bus_find_device().
> We also need to drop the reference taken by bus_find_device.
> 
> Fixes: 08805fdbeb2d ("RDMA/hns: Split hw v1 driver from hns roce driver")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 1 +
>  1 file changed, 1 insertion(+)

This file was removed in the commit 38d220882426 ("RDMA/hns: Remove
support for HIP06").

BTW, please recheck your patch submission flow, the received emails have
broken "To ..." field that makes reply do not work.

Thanks

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

* Re: [PATCH] RDMA/hns: Fix missing put_device call in hns_roce_get_cfg
  2022-01-10  7:44 ` Leon Romanovsky
@ 2022-01-10  8:23   ` Miaoqian Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Miaoqian Lin @ 2022-01-10  8:23 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Wenpeng Liang, Weihang Li, Jason Gunthorpe, Wei Hu(Xavier),
	Shaobo Xu, Doug Ledford, Lijun Ou, linux-rdma, linux-kernel

Hi Leon,
On Mon, Jan 10, 2022 at 09:44:12AM +0200, Leon Romanovsky wrote:
> 
> This file was removed in the commit 38d220882426 ("RDMA/hns: Remove
> support for HIP06").
> 
> BTW, please recheck your patch submission flow, the received emails have
> broken "To ..." field that makes reply do not work.
> 
Thanks for reminding me. I'll check it.


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

end of thread, other threads:[~2022-01-10  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10  6:12 [PATCH] RDMA/hns: Fix missing put_device call in hns_roce_get_cfg Miaoqian Lin
2022-01-10  7:44 ` Leon Romanovsky
2022-01-10  8:23   ` Miaoqian Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).