Re: [PATCH] vdpa/pds: check virtqueue notify mapping

"Creeley, Brett" <[email protected]> Wed, 5 Aug 2026 13:40:39 -0700
Newsgroups dev.linux.lists.virtualization,org.kernel.vger.linux-kernel
Message-ID <[email protected]>

On 8/4/2026 1:53 AM, Xiong Weimin wrote:
> [You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> 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 <[email protected]>
> ---
>   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);

Nit, but why dev_warn() instead of dev_err()? It looks like this was 
copied, but I wonder if the other spot should be a dev_err() instead of 
dev_warn too?

Other than that, LGTM.

Reviewed-by: Brett Creeley <[email protected]>
> +                       goto err_unmap;
> +               }
> +
>                  pds_vdpa_init_vqs_entry(pdsv, i, notify);
>          }
>
> --
> 2.43.0
>