]> Git Repo - linux.git/commitdiff
vfio/pds: fix return value in pds_vfio_get_lm_file()
authorYang Yingliang <[email protected]>
Sat, 19 Aug 2023 02:37:16 +0000 (10:37 +0800)
committerAlex Williamson <[email protected]>
Mon, 21 Aug 2023 14:50:33 +0000 (08:50 -0600)
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 <[email protected]>
Reviewed-by: Brett Creeley <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
drivers/vfio/pci/pds/lm.c

index aec75574cab32653f679b60484584215e0c8479f..79fe2e66bb498682e46435df5dbc996fe46899b3 100644 (file)
@@ -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);
This page took 0.056476 seconds and 4 git commands to generate.