[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230821090849.79fe44a4.alex.williamson@redhat.com>
Date: Mon, 21 Aug 2023 09:08:49 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: Yang Yingliang <yangyingliang@...wei.com>
Cc: <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<brett.creeley@....com>, <jgg@...pe.ca>, <yishaih@...dia.com>,
<shameerali.kolothum.thodi@...wei.com>, <kevin.tian@...el.com>,
<horms@...nel.org>, <shannon.nelson@....com>
Subject: Re: [PATCH -next] vfio/pds: fix return value in
pds_vfio_get_lm_file()
On Sat, 19 Aug 2023 10:37:16 +0800
Yang Yingliang <yangyingliang@...wei.com> wrote:
> anon_inode_getfile() never returns NULL pointer, it will return
> ERR_PTR() when it fails, so replace the check with IS_ERR().
>
> Fixes: bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support")
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
> ---
> drivers/vfio/pci/pds/lm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vfio/pci/pds/lm.c b/drivers/vfio/pci/pds/lm.c
> index aec75574cab3..79fe2e66bb49 100644
> --- a/drivers/vfio/pci/pds/lm.c
> +++ b/drivers/vfio/pci/pds/lm.c
> @@ -31,7 +31,7 @@ pds_vfio_get_lm_file(const struct file_operations *fops, int flags, u64 size)
> /* Create file */
> lm_file->filep =
> anon_inode_getfile("pds_vfio_lm", fops, lm_file, flags);
> - if (!lm_file->filep)
> + if (IS_ERR(lm_file->filep))
> goto out_free_file;
>
> stream_open(lm_file->filep->f_inode, lm_file->filep);
Applied to vfio next branch for v6.6. Thanks,
Alex
Powered by blists - more mailing lists