diff --git a/lib/ftl/ftl_reloc.c b/lib/ftl/ftl_reloc.c index c696d714c..d00e8b5df 100644 --- a/lib/ftl/ftl_reloc.c +++ b/lib/ftl/ftl_reloc.c @@ -612,7 +612,7 @@ ftl_band_reloc_init(struct ftl_reloc *reloc, struct ftl_band_reloc *breloc, static void ftl_band_reloc_free(struct ftl_band_reloc *breloc) { - struct ftl_reloc *reloc = breloc->parent; + struct ftl_reloc *reloc; struct ftl_io *io; size_t i, num_ios; @@ -620,6 +620,8 @@ ftl_band_reloc_free(struct ftl_band_reloc *breloc) return; } + reloc = breloc->parent; + if (breloc->active) { num_ios = spdk_ring_dequeue(breloc->write_queue, (void **)reloc->io, reloc->max_qdepth); for (i = 0; i < num_ios; ++i) {