hw/nvme: fix aio cancel in zone reset
If the zone reset operation is cancelled but the block unmap operation completes normally, the callback will continue resetting the next zone since it neglects to check iocb->ret which will have been set to -ECANCELED. Make sure that this is checked and bail out if an error is present. Secondly, fix a potential use-after-free by removing the bottom half and enqueuing the completion directly. Fixes: 63d96e4f ("hw/nvme: reimplement zone reset to allow cancellation") Reviewed-by:Keith Busch <kbusch@kernel.org> Signed-off-by:
Klaus Jensen <k.jensen@samsung.com>
Loading
Please register or sign in to comment