From: Jesper Juhl Date: Fri, 24 Dec 2010 22:01:12 +0000 (+0100) Subject: ceph: Always free allocated memory in osdmap_decode() X-Git-Tag: upstream/snapshot3+hdmi~11421^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0aee3516d84c05240065a53f238ba7a718f56b9;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Sage Weil --- diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index d73f3f6..71603ac 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); }