diff options
author | Sage Weil <sage@newdream.net> | 2010-06-13 13:30:19 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-06-13 13:34:36 -0400 |
commit | ae32be31341a5fecfa16c5b3eb78095207182cce (patch) | |
tree | 1fb056abaab9a6ca5f593dba6237f6ebc0f6135c /fs/ceph | |
parent | 4a32f93d29b05cdab63c0e2979bc1524c8ea6bf5 (diff) |
ceph: fix message memory leak, uninitialized variable
We need to properly initialize skip, as not all alloc_msg op instances
set it.
Also, BUG if someone says skip but also allocates a message.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/messenger.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/messenger.c b/fs/ceph/messenger.c index cf1c7845d877..9ad43a310a41 100644 --- a/fs/ceph/messenger.c +++ b/fs/ceph/messenger.c | |||
@@ -1396,10 +1396,12 @@ static int read_partial_message(struct ceph_connection *con) | |||
1396 | if (!con->in_msg) { | 1396 | if (!con->in_msg) { |
1397 | dout("got hdr type %d front %d data %d\n", con->in_hdr.type, | 1397 | dout("got hdr type %d front %d data %d\n", con->in_hdr.type, |
1398 | con->in_hdr.front_len, con->in_hdr.data_len); | 1398 | con->in_hdr.front_len, con->in_hdr.data_len); |
1399 | skip = 0; | ||
1399 | con->in_msg = ceph_alloc_msg(con, &con->in_hdr, &skip); | 1400 | con->in_msg = ceph_alloc_msg(con, &con->in_hdr, &skip); |
1400 | if (skip) { | 1401 | if (skip) { |
1401 | /* skip this message */ | 1402 | /* skip this message */ |
1402 | dout("alloc_msg said skip message\n"); | 1403 | dout("alloc_msg said skip message\n"); |
1404 | BUG_ON(con->in_msg); | ||
1403 | con->in_base_pos = -front_len - middle_len - data_len - | 1405 | con->in_base_pos = -front_len - middle_len - data_len - |
1404 | sizeof(m->footer); | 1406 | sizeof(m->footer); |
1405 | con->in_tag = CEPH_MSGR_TAG_READY; | 1407 | con->in_tag = CEPH_MSGR_TAG_READY; |