From: Bjorn Helgaas <helgaas@kernel.org>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
Dan Carpenter <dan.carpenter@oracle.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] PCI/P2PDMA: Fix NULL check in pci_p2pmem_publish()
Date: Wed, 17 Oct 2018 12:19:02 -0500 [thread overview]
Message-ID: <20181017171902.GH5906@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <20181017160510.17926-1-logang@deltatee.com>
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@deltatee.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Christoph Hellwig <hch@infradead.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
>
prev parent reply other threads:[~2018-10-17 17:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-17 16:05 Logan Gunthorpe
2018-10-17 17:19 ` Bjorn Helgaas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181017171902.GH5906@bhelgaas-glaptop.roam.corp.google.com \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=dan.carpenter@oracle.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®