All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Liam Ni <zhiguangni01@gmail.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"cohuck@redhat.com" <cohuck@redhat.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] vfio: check iommu_group_set_name() return value
Date: Wed, 29 Jun 2022 06:21:44 +0000	[thread overview]
Message-ID: <BN9PR11MB52768490C7979AF1228B7AC58CBB9@BN9PR11MB5276.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220625114239.9301-1-zhiguangni01@gmail.com>

> From: Liam Ni <zhiguangni01@gmail.com>
> Sent: Saturday, June 25, 2022 7:43 PM
> 
> As iommu_group_set_name() can fail,we should check the return value.
> 
> Signed-off-by: Liam Ni <zhiguangni01@gmail.com>

Reviewed-by: Kevin Tian <kevin.tian@intel.com>.

btw you probably also want to change other callers of this
function for the same issue.

> ---
>  drivers/vfio/vfio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> 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;
> --
> 2.25.1


  reply	other threads:[~2022-06-29  6:21 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 [this message]
2022-06-29 17:54 ` Jason Gunthorpe
2022-06-30 19:51 ` Alex Williamson

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=BN9PR11MB52768490C7979AF1228B7AC58CBB9@BN9PR11MB5276.namprd11.prod.outlook.com \
    --to=kevin.tian@intel.com \
    --cc=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.