Commit f181a373 authored by Yuxue Liu's avatar Yuxue Liu Committed by Michael S. Tsirkin

vp_vdpa: Fix return value check vp_vdpa_request_irq

In the vp_vdpa_set_status function, when setting the device status to
VIRTIO_CONFIG_S_DRIVER_OK, the vp_vdpa_request_irq function may fail.
In such cases, the device status should not be set to DRIVER_OK. Add
exception printing to remind the user.
Signed-off-by: default avatarYuxue Liu <yuxue.liu@jaguarmicro.com>
Message-Id: <20240325105448.235-1-gavin.liu@jaguarmicro.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent e117d9b6
......@@ -216,7 +216,10 @@ static void vp_vdpa_set_status(struct vdpa_device *vdpa, u8 status)
if (status & VIRTIO_CONFIG_S_DRIVER_OK &&
!(s & VIRTIO_CONFIG_S_DRIVER_OK)) {
vp_vdpa_request_irq(vp_vdpa);
if (vp_vdpa_request_irq(vp_vdpa)) {
WARN_ON(1);
return;
}
}
vp_modern_set_status(mdev, status);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment