aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/messenger.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-12-14 17:30:34 -0500
committerSage Weil <sage@newdream.net>2009-12-21 19:39:49 -0500
commit5e095e8b40b0402ad3bcadc5b8d84c38b26c30b2 (patch)
tree206caf0f708b6be65b41132272052f2ac8f9224c /fs/ceph/messenger.c
parentc86a2930ccbd90d77c54d04b5c2bbec95b989e40 (diff)
ceph: plug msg leak in con_fault
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/messenger.c')
-rw-r--r--fs/ceph/messenger.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ceph/messenger.c b/fs/ceph/messenger.c
index 96fd556a7804..98519bd33f04 100644
--- a/fs/ceph/messenger.c
+++ b/fs/ceph/messenger.c
@@ -1434,8 +1434,9 @@ no_data:
1434 */ 1434 */
1435static void process_message(struct ceph_connection *con) 1435static void process_message(struct ceph_connection *con)
1436{ 1436{
1437 struct ceph_msg *msg = con->in_msg; 1437 struct ceph_msg *msg;
1438 1438
1439 msg = con->in_msg;
1439 con->in_msg = NULL; 1440 con->in_msg = NULL;
1440 1441
1441 /* if first message, set peer_name */ 1442 /* if first message, set peer_name */
@@ -1810,7 +1811,11 @@ static void ceph_fault(struct ceph_connection *con)
1810 clear_bit(BUSY, &con->state); /* to avoid an improbable race */ 1811 clear_bit(BUSY, &con->state); /* to avoid an improbable race */
1811 1812
1812 con_close_socket(con); 1813 con_close_socket(con);
1813 con->in_msg = NULL; 1814
1815 if (con->in_msg) {
1816 ceph_msg_put(con->in_msg);
1817 con->in_msg = NULL;
1818 }
1814 1819
1815 /* If there are no messages in the queue, place the connection 1820 /* If there are no messages in the queue, place the connection
1816 * in a STANDBY state (i.e., don't try to reconnect just yet). */ 1821 * in a STANDBY state (i.e., don't try to reconnect just yet). */