All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	RDMA mailing list
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Jack Morgenstein
	<jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
	Mark Bloch <markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH rdma-next 5/5] RDMA/cm: Fix access to uninitialized variable
Date: Sun, 28 Jan 2018 11:25:33 +0200	[thread overview]
Message-ID: <20180128092533.4156-6-leon@kernel.org> (raw)
In-Reply-To: <20180128092533.4156-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

The ndev will be held only for successful ib_get_cached_gid()
and hence no need to use dev_put() in failure path.

Fixes: 16c72e402867 ("IB/cm: Refactor to avoid setting path record software only fields")
Signed-off-by: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/core/cm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 68df93558d80..e6749157fd86 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -1901,8 +1901,6 @@ static int cm_req_handler(struct cm_work *work)
 				grh->sgid_index,
 				&gid, &gid_attr);
 	if (ret) {
-		if (gid_attr.ndev)
-			dev_put(gid_attr.ndev);
 		ib_send_cm_rej(cm_id, IB_CM_REJ_UNSUPPORTED, NULL, 0, NULL, 0);
 		goto rejected;
 	}
-- 
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-01-28  9:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-28  9:25 [PATCH rdma-next 0/5] RDMA fixes for 4.16 Leon Romanovsky
     [not found] ` <20180128092533.4156-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28  9:25   ` [PATCH rdma-next 1/5] IB/umad: Fix use of unprotected device pointer Leon Romanovsky
2018-01-28  9:25   ` [PATCH rdma-next 2/5] RDMA/mlx5: Avoid memory leak in case of XRCD dealloc failure Leon Romanovsky
     [not found]     ` <20180128092533.4156-3-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28 11:07       ` Yuval Shaia
2018-01-28 12:52         ` Leon Romanovsky
     [not found]           ` <20180128125208.GX1393-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-28 13:25             ` Yuval Shaia
2018-01-28 13:37               ` Leon Romanovsky
     [not found]                 ` <20180128133755.GY1393-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-28 16:19                   ` Jason Gunthorpe
2018-01-28  9:25   ` [PATCH rdma-next 3/5] IB/core: Avoid SGID attributes query while converting GID from OPA to IB Leon Romanovsky
     [not found]     ` <20180128092533.4156-4-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28 11:11       ` Yuval Shaia
2018-01-28  9:25   ` [PATCH rdma-next 4/5] RDMA/cma: Use existing netif_is_bond_master function Leon Romanovsky
     [not found]     ` <20180128092533.4156-5-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28 11:22       ` Yuval Shaia
2018-01-28  9:25   ` Leon Romanovsky [this message]
     [not found]     ` <20180128092533.4156-6-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28 11:38       ` [PATCH rdma-next 5/5] RDMA/cm: Fix access to uninitialized variable Yuval Shaia
2018-01-28 21:12   ` [PATCH rdma-next 0/5] RDMA fixes for 4.16 Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180128092533.4156-6-leon@kernel.org \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.