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] [day] [month] [year] [list]
Date:   Wed, 17 Oct 2018 12:19:02 -0500
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Logan Gunthorpe <logang@...tatee.com>
Cc:     linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH] PCI/P2PDMA: Fix NULL check in pci_p2pmem_publish()

On Wed, Oct 17, 2018 at 10:05:10AM -0600, Logan Gunthorpe wrote:
> We should only assign 'p2pmem_published' if 'pdev->p2pdma' is not NULL.
> The extra check on 'publish' makes no sense.
> 
> Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> Cc: Bjorn Helgaas <bhelgaas@...gle.com>
> Cc: Christoph Hellwig <hch@...radead.org>

I folded this into the original commit on pci/peer-to-peer, thanks!

> ---
>  drivers/pci/p2pdma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
> index da66c7e31730..d710b5ef65a1 100644
> --- a/drivers/pci/p2pdma.c
> +++ b/drivers/pci/p2pdma.c
> @@ -678,10 +678,8 @@ EXPORT_SYMBOL_GPL(pci_p2pmem_free_sgl);
>   */
>  void pci_p2pmem_publish(struct pci_dev *pdev, bool publish)
>  {
> -	if (publish && !pdev->p2pdma)
> -		return;
> -
> -	pdev->p2pdma->p2pmem_published = publish;
> +	if (pdev->p2pdma)
> +		pdev->p2pdma->p2pmem_published = publish;
>  }
>  EXPORT_SYMBOL_GPL(pci_p2pmem_publish);
>  
> -- 
> 2.19.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ