The SCSI backend doesn't call disk_image__new() so the disk ops are NULL. Check for this case on exit. Signed-off-by: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx> --- disk/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disk/core.c b/disk/core.c index 45681024..35689b8e 100644 --- a/disk/core.c +++ b/disk/core.c @@ -223,10 +223,10 @@ static int disk_image__close(struct disk_image *disk) disk_aio_destroy(disk); - if (disk->ops->close) + if (disk->ops && disk->ops->close) return disk->ops->close(disk); - if (close(disk->fd) < 0) + if (disk->fd && close(disk->fd) < 0) pr_warning("close() failed"); free(disk); -- 2.40.0