[bug report] PCI/P2PDMA: Support peer-to-peer memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Logan Gunthorpe,

This is a semi-automatic email about new static checker warnings.

The patch 31fd98513249: "PCI/P2PDMA: Support peer-to-peer memory" 
from Oct 4, 2018, leads to the following Smatch complaint:

    drivers/pci/p2pdma.c:684 pci_p2pmem_publish()
     error: we previously assumed 'pdev->p2pdma' could be null (see line 681)

drivers/pci/p2pdma.c
   680	{
   681		if (publish && !pdev->p2pdma)
                    ^^^^^^^^^^^^^^^^^^^^^^^^

It feels like this should just be:

		if (!pdev->p2pdma)

In other words, I don't understand why we are testing "publish"...

   682			return;
   683	
   684		pdev->p2pdma->p2pmem_published = publish;
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   685	}
   686	EXPORT_SYMBOL_GPL(pci_p2pmem_publish);

regards,
dan carpenter



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux