From: Yang Yingliang <yangyingliang@huawei.com>
To: <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>, <yangyingliang@huawei.com>
Subject: [PATCH -next] vfio/pds: fix return value in pds_vfio_get_lm_file()
Date: Sat, 19 Aug 2023 10:37:16 +0800 [thread overview]
Message-ID: <20230819023716.3469037-1-yangyingliang@huawei.com> (raw)
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;
stream_open(lm_file->filep->f_inode, lm_file->filep);
--
2.25.1
next reply other threads:[~2023-08-19 2:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-19 2:37 Yang Yingliang [this message]
2023-08-19 18:15 ` [PATCH -next] vfio/pds: fix return value in pds_vfio_get_lm_file() Brett Creeley
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=20230819023716.3469037-1-yangyingliang@huawei.com \
--to=yangyingliang@huawei.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=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 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.