From: Dmitry Tikhov Date: Fri, 15 Apr 2022 20:48:32 +0000 (+0300) Subject: hw/nvme: add missing return statement X-Git-Tag: v7.1.0-rc0~77^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51c453266309166c2737623211c0afc12884cccd;p=thirdparty%2Fqemu.git hw/nvme: add missing return statement Since there is no return after nvme_dsm_cb invocation, metadata associated with non-zero block range is currently zeroed. Also this behaviour leads to segfault since we schedule iocb->bh two times. First when entering nvme_dsm_cb with iocb->idx == iocb->nr and second because of missing return on call stack unwinding by calling blk_aio_pwrite_zeroes and subsequent nvme_dsm_cb callback. Fixes: d7d1474fd85d ("hw/nvme: reimplement dsm to allow cancellation") Signed-off-by: Dmitry Tikhov Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 03760ddeae8..74540a03d51 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -2372,6 +2372,7 @@ static void nvme_dsm_md_cb(void *opaque, int ret) } nvme_dsm_cb(iocb, 0); + return; } iocb->aiocb = blk_aio_pwrite_zeroes(ns->blkconf.blk, nvme_moff(ns, slba),