summaryrefslogtreecommitdiff
path: root/drivers/vdpa
diff options
context:
space:
mode:
authorYuxue Liu <yuxue.liu@jaguarmicro.com>2024-03-25 13:54:47 +0300
committerMichael S. Tsirkin <mst@redhat.com>2024-05-22 15:31:15 +0300
commitf181a3736b7f76410040a3f16cbbfbdec2580bf9 (patch)
tree834db1a19be03dda83b8cea62beb27515c2e37bf /drivers/vdpa
parente117d9b6e79a2466faf382cb7e8e8823e82d6bd5 (diff)
downloadlinux-f181a3736b7f76410040a3f16cbbfbdec2580bf9.tar.xz
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: Yuxue Liu <yuxue.liu@jaguarmicro.com> Message-Id: <20240325105448.235-1-gavin.liu@jaguarmicro.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vdpa')
-rw-r--r--drivers/vdpa/virtio_pci/vp_vdpa.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c
index df5f4a3bccb5..4caca0517cad 100644
--- a/drivers/vdpa/virtio_pci/vp_vdpa.c
+++ b/drivers/vdpa/virtio_pci/vp_vdpa.c
@@ -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);