All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Liam Ni <zhiguangni01@gmail.com>
Cc: cohuck@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfio: check iommu_group_set_name() return value
Date: Thu, 30 Jun 2022 13:51:41 -0600	[thread overview]
Message-ID: <20220630135141.4fd4c4d5.alex.williamson@redhat.com> (raw)
In-Reply-To: <20220625114239.9301-1-zhiguangni01@gmail.com>

On Sat, 25 Jun 2022 19:42:39 +0800
Liam Ni <zhiguangni01@gmail.com> wrote:

> As iommu_group_set_name() can fail,we should check the return value.
> 
> Signed-off-by: Liam Ni <zhiguangni01@gmail.com>
> ---
>  drivers/vfio/vfio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied to vfio next branch for v5.20.  Thanks,

Alex

> 
> diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
> index 61e71c1154be..ca823eeac237 100644
> --- a/drivers/vfio/vfio.c
> +++ b/drivers/vfio/vfio.c
> @@ -504,7 +504,9 @@ static struct vfio_group *vfio_noiommu_group_alloc(struct device *dev,
>  	if (IS_ERR(iommu_group))
>  		return ERR_CAST(iommu_group);
>  
> -	iommu_group_set_name(iommu_group, "vfio-noiommu");
> +	ret = iommu_group_set_name(iommu_group, "vfio-noiommu");
> +	if (ret)
> +		goto out_put_group;
>  	ret = iommu_group_add_device(iommu_group, dev);
>  	if (ret)
>  		goto out_put_group;


      parent reply	other threads:[~2022-06-30 19:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-25 11:42 [PATCH] vfio: check iommu_group_set_name() return value Liam Ni
2022-06-29  6:21 ` Tian, Kevin
2022-06-29 17:54 ` Jason Gunthorpe
2022-06-30 19:51 ` Alex Williamson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220630135141.4fd4c4d5.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhiguangni01@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.