mirror of
https://github.com/qemu/qemu.git
synced 2026-05-17 15:30:34 +00:00
virtio-gpu: fix error handling in virgl_cmd_resource_create_blob
Fix inverted error check in virgl_cmd_resource_create_blob() that causes the function to return error when virtio_gpu_create_mapping_iov() succeeds. virtio_gpu_create_mapping_iov() returns 0 on success and negative values on error. The check 'if (!ret)' incorrectly treats success (ret=0) as an error condition, causing the function to fail when it should succeed. Change the condition to 'if (ret != 0)' to properly detect errors. Fixes:7c092f17cc("virtio-gpu: Handle resource blob commands") Signed-off-by: Honglei Huang <honghuan@amd.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260113015203.3643608-2-honghuan@amd.com> (cherry picked from commit3560b51979) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
committed by
Michael Tokarev
parent
90b3d44f6d
commit
12ce00e31a
@@ -701,7 +701,7 @@ static void virgl_cmd_resource_create_blob(VirtIOGPU *g,
|
||||
ret = virtio_gpu_create_mapping_iov(g, cblob.nr_entries, sizeof(cblob),
|
||||
cmd, &res->base.addrs,
|
||||
&res->base.iov, &res->base.iov_cnt);
|
||||
if (!ret) {
|
||||
if (ret != 0) {
|
||||
cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user