diff --git a/balloc/ut/balloc.c b/balloc/ut/balloc.c index ccd60351025..1fb0fbd4ac6 100644 --- a/balloc/ut/balloc.c +++ b/balloc/ut/balloc.c @@ -118,6 +118,7 @@ int test_balloc_ut_ops(struct m0_be_ut_backend *ut_be, struct m0_be_seg *seg, grp = m0_be_ut_backend_sm_group_lookup(ut_be); rc = m0_balloc_create(0, seg, grp, &motr_balloc, &M0_FID_INIT(0, 1)); M0_UT_ASSERT(rc == 0); + motr_balloc->cb_ballroom.ab_ops->bo_fini(&motr_balloc->cb_ballroom); rc = motr_balloc->cb_ballroom.ab_ops->bo_init (&motr_balloc->cb_ballroom, seg, BALLOC_DEF_BLOCK_SHIFT, diff --git a/be/extmap.c b/be/extmap.c index 7691ef7610e..b87aaab6165 100644 --- a/be/extmap.c +++ b/be/extmap.c @@ -1225,9 +1225,9 @@ static int emap_it_open(struct m0_be_emap_cursor *it, int prev_rc) ext->ee_val = rec->er_value; ext->ee_cksum_buf.b_nob = rec->er_cksum_nob; ext->ee_cksum_buf.b_addr = rec->er_cksum_nob ? - (void *)&rec->er_footer : NULL; + (void *)&rec->er_footer : NULL; it->ec_unit_size = rec->er_unit_size; - if (!emap_it_prefix_ok(it)) + if (!emap_it_prefix_ok(it)) rc = -ESRCH; } it->ec_op.bo_u.u_emap.e_rc = rc; @@ -1254,7 +1254,7 @@ static void emap_it_init(struct m0_be_emap_cursor *it, static void be_emap_close(struct m0_be_emap_cursor *it) { if (it->ec_recbuf.b_addr != NULL ) { - m0_buf_free(&it->ec_recbuf); + m0_buf_free(&it->ec_recbuf); } m0_btree_cursor_fini(&it->ec_cursor); @@ -1537,6 +1537,10 @@ be_emap_split(struct m0_be_emap_cursor *it, rc = emap_it_get(it); it->ec_op.bo_u.u_emap.e_rc = rc; + if (it->ec_recbuf.b_addr != NULL) { + m0_buf_free(&it->ec_recbuf); + it->ec_recbuf.b_addr = NULL; + } return M0_RC(rc); } diff --git a/stob/ad.c b/stob/ad.c index 56664fc36b8..a849c5865d4 100644 --- a/stob/ad.c +++ b/stob/ad.c @@ -555,6 +555,7 @@ static int stob_ad_domain_create(struct m0_stob_type *type, */ rc = m0_balloc_create(dom_key, seg, grp, &cb, &cfg->adg_id.si_fid); + cb->cb_ballroom.ab_ops->bo_fini(&cb->cb_ballroom); rc = rc ?: m0_be_tx_exclusive_open_sync(&tx); M0_ASSERT(adom == NULL);