diff options
author | Sage Weil <sage@newdream.net> | 2009-12-14 23:30:34 +0100 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-12-22 01:39:49 +0100 |
commit | 5e095e8b40b0402ad3bcadc5b8d84c38b26c30b2 (patch) | |
tree | 206caf0f708b6be65b41132272052f2ac8f9224c /fs | |
parent | ceph: carry explicit msg reference for currently sending message (diff) | |
download | linux-5e095e8b40b0402ad3bcadc5b8d84c38b26c30b2.tar.xz linux-5e095e8b40b0402ad3bcadc5b8d84c38b26c30b2.zip |
ceph: plug msg leak in con_fault
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/messenger.c | 9 |
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: */ static void process_message(struct ceph_connection *con) { - struct ceph_msg *msg = con->in_msg; + struct ceph_msg *msg; + msg = con->in_msg; con->in_msg = NULL; /* if first message, set peer_name */ @@ -1810,7 +1811,11 @@ static void ceph_fault(struct ceph_connection *con) clear_bit(BUSY, &con->state); /* to avoid an improbable race */ con_close_socket(con); - con->in_msg = NULL; + + if (con->in_msg) { + ceph_msg_put(con->in_msg); + con->in_msg = NULL; + } /* If there are no messages in the queue, place the connection * in a STANDBY state (i.e., don't try to reconnect just yet). */ |