kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch -next] libceph: fix NULL dereference in reset_connection()
@ 2012-06-19 10:33 Dan Carpenter
  2012-06-19 13:27 ` Alex Elder
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2012-06-19 10:33 UTC (permalink / raw)
  To: Sage Weil, Alex Elder; +Cc: ceph-devel, kernel-janitors

We dereference "con->in_msg" on the line after it was set to NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 5e9f61d..6aa671c 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -437,10 +437,10 @@ static void reset_connection(struct ceph_connection *con)
 
 	if (con->in_msg) {
 		BUG_ON(con->in_msg->con != con);
+		ceph_con_put(con->in_msg->con);
 		con->in_msg->con = NULL;
 		ceph_msg_put(con->in_msg);
 		con->in_msg = NULL;
-		ceph_con_put(con->in_msg->con);
 	}
 
 	con->connect_seq = 0;

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

end of thread, other threads:[~2012-06-19 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-19 10:33 [patch -next] libceph: fix NULL dereference in reset_connection() Dan Carpenter
2012-06-19 13:27 ` Alex Elder
2012-06-19 13:33   ` Dan Carpenter
2012-06-19 13:57     ` [PATCH] " Alex Elder

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