diff --git a/lib/ftl/ftl_core.c b/lib/ftl/ftl_core.c index c1ff799d8..5f3689ecc 100644 --- a/lib/ftl/ftl_core.c +++ b/lib/ftl/ftl_core.c @@ -1468,7 +1468,11 @@ ftl_io_child_write_cb(struct ftl_io *io, void *ctx, int status) chunk->busy = false; chunk->write_offset += io->lbk_cnt; - wptr->num_outstanding--; + + /* If some other write on the same band failed the write pointer would already be freed */ + if (spdk_likely(wptr)) { + wptr->num_outstanding--; + } } static int