aboutsummaryrefslogtreecommitdiff
path: root/net/ceph
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2010-12-24 23:01:12 +0100
committerSage Weil <sage@newdream.net>2011-01-12 15:15:14 -0800
commitb0aee3516d84c05240065a53f238ba7a718f56b9 (patch)
tree13877be944725cd055782289fe0260ac69cb87f8 /net/ceph
parent582c86e69045f37da8be445c265f72a7a73b18c6 (diff)
ceph: Always free allocated memory in osdmap_decode()
Always free memory allocated to 'pi' in net/ceph/osdmap.c::osdmap_decode(). Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/osdmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index d73f3f6efa3..71603ac3dff 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -605,8 +605,10 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end)
goto bad;
}
err = __decode_pool(p, end, pi);
- if (err < 0)
+ if (err < 0) {
+ kfree(pi);
goto bad;
+ }
__insert_pg_pool(&map->pg_pools, pi);
}