mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 15:40:03 +02:00
vdpa/pds: check virtqueue notify mapping
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> Reviewed-by: Brett Creeley <brett.creeley@amd.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <20260806005809.1875257-1-xiongweimin@kylinos.cn>
This commit is contained in:
parent
d14d693adb
commit
6601d5a008
|
|
@ -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_err(dev, "Fail to map vq notify %d\n", i);
|
||||
goto err_unmap;
|
||||
}
|
||||
|
||||
pds_vdpa_init_vqs_entry(pdsv, i, notify);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user