linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-next] IB/cm: Release previously acquired reference counter in the cm_id_priv
@ 2022-01-19  8:37 Leon Romanovsky
  2022-01-28 16:51 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2022-01-19  8:37 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: Mark Zhang, Dan Carpenter, linux-kernel, linux-rdma

From: Mark Zhang <markzhang@nvidia.com>

In failure flow, the reference counter acquired was not released,
and the following error was reported:

  drivers/infiniband/core/cm.c:3373 cm_lap_handler() warn: inconsistent
			refcounting 'cm_id_priv->refcount.refs.counter':

Fixes: 7345201c3963 ("IB/cm: Improve the calling of cm_init_av_for_lap and cm_init_av_by_path")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Zhang <markzhang@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/core/cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index c903b74f46a4..35f0d5e7533d 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3322,7 +3322,7 @@ static int cm_lap_handler(struct cm_work *work)
 	ret = cm_init_av_by_path(param->alternate_path, NULL, &alt_av);
 	if (ret) {
 		rdma_destroy_ah_attr(&ah_attr);
-		return -EINVAL;
+		goto deref;
 	}
 
 	spin_lock_irq(&cm_id_priv->lock);
-- 
2.34.1


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

* Re: [PATCH rdma-next] IB/cm: Release previously acquired reference counter in the cm_id_priv
  2022-01-19  8:37 [PATCH rdma-next] IB/cm: Release previously acquired reference counter in the cm_id_priv Leon Romanovsky
@ 2022-01-28 16:51 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2022-01-28 16:51 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: Mark Zhang, Dan Carpenter, linux-kernel, linux-rdma

On Wed, Jan 19, 2022 at 10:37:55AM +0200, Leon Romanovsky wrote:
> From: Mark Zhang <markzhang@nvidia.com>
> 
> In failure flow, the reference counter acquired was not released,
> and the following error was reported:
> 
>   drivers/infiniband/core/cm.c:3373 cm_lap_handler() warn: inconsistent
> 			refcounting 'cm_id_priv->refcount.refs.counter':
> 
> Fixes: 7345201c3963 ("IB/cm: Improve the calling of cm_init_av_for_lap and cm_init_av_by_path")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Mark Zhang <markzhang@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
>  drivers/infiniband/core/cm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc, thanks

Jason

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

end of thread, other threads:[~2022-01-28 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-19  8:37 [PATCH rdma-next] IB/cm: Release previously acquired reference counter in the cm_id_priv Leon Romanovsky
2022-01-28 16:51 ` Jason Gunthorpe

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).