lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 19 Aug 2023 11:15:00 -0700
From:   Brett Creeley <bcreeley@....com>
To:     Yang Yingliang <yangyingliang@...wei.com>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     brett.creeley@....com, jgg@...pe.ca, yishaih@...dia.com,
        shameerali.kolothum.thodi@...wei.com, kevin.tian@...el.com,
        alex.williamson@...hat.com, horms@...nel.org,
        shannon.nelson@....com
Subject: Re: [PATCH -next] vfio/pds: fix return value in
 pds_vfio_get_lm_file()

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@...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;

LGTM! Thanks for fixing this.

Reviewed-by: Brett Creeley <brett.creeley@....com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ