Skip to contentSkip to conversation

ceph: add kfree() to error path

PATCH New Dan Carpenter 1 participant 1 message Jul 8, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: add kfree() to error path

We leak a "pi" on this error path.

fs/ceph/osdmap.c +1 -0
index 50ce64e..277f8b3 100644
@@ -568,6 +568,7 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end)
 		if (ev > CEPH_PG_POOL_VERSION) {
 			pr_warning("got unknown v %d > %d of ceph_pg_pool\n",
 				   ev, CEPH_PG_POOL_VERSION);
+			kfree(pi);
 			goto bad;
 		}
 		__decode_pool(p, pi);