diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 7f33d6f1cd1af3d32d2252285d42618a40405663..7f4de193c450e33e09692221bd2e6929999bc0f0 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -2111,8 +2111,9 @@ storageVolUpload(virStorageVolPtr obj, goto cleanup; } - ret = backend->uploadVol(obj->conn, pool, vol, stream, - offset, length, flags); + if ((ret = backend->uploadVol(obj->conn, pool, vol, stream, + offset, length, flags)) < 0) + goto cleanup; /* Add cleanup callback - call after uploadVol since the stream * is then fully set up