Linux virtualization list
 help / color / mirror / Atom feed
* [PATCH] vdpa/pds: check virtqueue notify mapping
@ 2026-08-04  8:53 Xiong Weimin
  2026-08-05 20:40 ` Creeley, Brett
  2026-08-06  0:58 ` Xiong Weimin
  0 siblings, 2 replies; 6+ messages in thread
From: Xiong Weimin @ 2026-08-04  8:53 UTC (permalink / raw)
  To: Brett Creeley, Michael S. Tsirkin, Jason Wang
  Cc: Xuan Zhuo, Eugenio Pérez, virtualization, linux-kernel,
	Xiong Weimin

vp_modern_map_vq_notify() can fail and return NULL.  Check the notify
mapping while adding a pds vDPA device and use the existing teardown path
instead of storing a NULL doorbell pointer in the virtqueue state.

Signed-off-by: Xiong Weimin <xiongweimin@kylinos.cn>
---
 drivers/vdpa/pds/vdpa_dev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/vdpa/pds/vdpa_dev.c b/drivers/vdpa/pds/vdpa_dev.c
index 43426bd97..df53cfce9 100644
--- a/drivers/vdpa/pds/vdpa_dev.c
+++ b/drivers/vdpa/pds/vdpa_dev.c
@@ -731,6 +731,12 @@ static int pds_vdpa_dev_add(struct vdpa_mgmt_dev *mdev, const char *name,
 
 		notify = vp_modern_map_vq_notify(&pdsv->vdpa_aux->vd_mdev,
 						 i, &pdsv->vqs[i].notify_pa);
+		if (!notify) {
+			err = -EINVAL;
+			dev_warn(dev, "Fail to map vq notify %d\n", i);
+			goto err_unmap;
+		}
+
 		pds_vdpa_init_vqs_entry(pdsv, i, notify);
 	}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-07  1:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04  8:53 [PATCH] vdpa/pds: check virtqueue notify mapping Xiong Weimin
2026-08-05 20:40 ` Creeley, Brett
2026-08-06  0:58 ` Xiong Weimin
2026-08-06 16:21   ` Creeley, Brett
2026-08-07  1:58     ` Xiong Weimin
2026-08-07  1:58       ` [PATCH] vdpa/virtio_pci: use dev_err for vq notify map failure Xiong Weimin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox