From: Brett Creeley <bcreeley@amd.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: brett.creeley@amd.com, jgg@ziepe.ca, yishaih@nvidia.com,
shameerali.kolothum.thodi@huawei.com, kevin.tian@intel.com,
alex.williamson@redhat.com, horms@kernel.org,
shannon.nelson@amd.com
Subject: Re: [PATCH -next] vfio/pds: fix return value in pds_vfio_get_lm_file()
Date: Sat, 19 Aug 2023 11:15:00 -0700 [thread overview]
Message-ID: <46efd108-8c3b-220f-1fa7-2f6a36f9c9cb@amd.com> (raw)
In-Reply-To: <20230819023716.3469037-1-yangyingliang@huawei.com>
On 8/18/2023 7:37 PM, Yang Yingliang wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> 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@huawei.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;
LGTM! Thanks for fixing this.
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
>
> stream_open(lm_file->filep->f_inode, lm_file->filep);
> --
> 2.25.1
>
next prev parent reply other threads:[~2023-08-20 0:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-19 2:37 Yang Yingliang
2023-08-19 18:15 ` Brett Creeley [this message]
2023-08-21 15:08 ` 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=46efd108-8c3b-220f-1fa7-2f6a36f9c9cb@amd.com \
--to=bcreeley@amd.com \
--cc=alex.williamson@redhat.com \
--cc=brett.creeley@amd.com \
--cc=horms@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=shannon.nelson@amd.com \
--cc=yangyingliang@huawei.com \
--cc=yishaih@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®