All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernard Metzler <bmt@zurich.ibm.com>
To: linux-rdma@vger.kernel.org
Cc: dan.carpenter@oracle.com, jgg@ziepe.ca,
	Bernard Metzler <bmt@zurich.ibm.com>
Subject: [PATCH] siw: Fix potential NULL pointer in siw_connect().
Date: Mon, 19 Aug 2019 16:02:57 +0200	[thread overview]
Message-ID: <20190819140257.19319-1-bmt@zurich.ibm.com> (raw)

Fixes: 6c52fdc244b5 ("rdma/siw: connection management")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
---
 drivers/infiniband/sw/siw/siw_cm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
index 9ce8a1b925d2..fc97571a640b 100644
--- a/drivers/infiniband/sw/siw/siw_cm.c
+++ b/drivers/infiniband/sw/siw/siw_cm.c
@@ -1515,7 +1515,7 @@ int siw_connect(struct iw_cm_id *id, struct iw_cm_conn_param *params)
 		}
 	}
 error:
-	siw_dbg_qp(qp, "failed: %d\n", rv);
+	siw_dbg(id->device, "failed: %d\n", rv);
 
 	if (cep) {
 		siw_socket_disassoc(s);
@@ -1540,7 +1540,8 @@ int siw_connect(struct iw_cm_id *id, struct iw_cm_conn_param *params)
 	} else if (s) {
 		sock_release(s);
 	}
-	siw_qp_put(qp);
+	if (qp)
+		siw_qp_put(qp);
 
 	return rv;
 }
-- 
2.17.2


             reply	other threads:[~2019-08-19 14:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 14:02 Bernard Metzler [this message]
2019-08-20 16:05 ` [PATCH] siw: Fix potential NULL pointer in siw_connect() Doug Ledford
2019-08-21 12:56   ` Dan Carpenter
2019-08-21 13:39     ` Doug Ledford
2019-08-21 14:12       ` Jason Gunthorpe
2019-08-21 16:30         ` Leon Romanovsky
2019-08-22  6:35         ` Gal Pressman
2019-08-22  7:10         ` Dan Carpenter
2019-08-22 12:02           ` Jason Gunthorpe
2019-08-22 15:02             ` Doug Ledford
2019-08-20 16:11 ` Bernard Metzler

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=20190819140257.19319-1-bmt@zurich.ibm.com \
    --to=bmt@zurich.ibm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.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.