Skip to content

Commit 2d12d18

Browse files
Yang Yingliangawilliam
authored andcommitted
vfio/pds: fix return value in pds_vfio_get_lm_file()
anon_inode_getfile() never returns NULL pointer, it will return ERR_PTR() when it fails, so replace the check with IS_ERR(). Fixes: bb500db ("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]>
1 parent 06d220f commit 2d12d18

File tree

1 file changed

+1
-1
lines changed
  • drivers/vfio/pci/pds

1 file changed

+1
-1
lines changed

drivers/vfio/pci/pds/lm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pds_vfio_get_lm_file(const struct file_operations *fops, int flags, u64 size)
3131
/* Create file */
3232
lm_file->filep =
3333
anon_inode_getfile("pds_vfio_lm", fops, lm_file, flags);
34-
if (!lm_file->filep)
34+
if (IS_ERR(lm_file->filep))
3535
goto out_free_file;
3636

3737
stream_open(lm_file->filep->f_inode, lm_file->filep);

0 commit comments

Comments
 (0)