From: Dan Carpenter <dan.carpenter@oracle.com>
To: kishon@ti.com
Cc: linux-pci@vger.kernel.org
Subject: [bug report] PCI: endpoint: Add EP core layer to enable EP controller and EP functions
Date: Thu, 24 Aug 2017 13:37:42 +0300 [thread overview]
Message-ID: <20170824103742.ik3tcfa2fcgcdza4@mwanda> (raw)
Hello Kishon Vijay Abraham I,
The patch 5e8cb4033807: "PCI: endpoint: Add EP core layer to enable
EP controller and EP functions" from Apr 10, 2017, leads to the
following static checker warning:
drivers/pci/endpoint/pci-epc-core.c:379 pci_epc_add_epf()
warn: 'epc' isn't an ERR_PTR
drivers/pci/endpoint/pci-epc-core.c
370 */
371 int pci_epc_add_epf(struct pci_epc *epc, struct pci_epf *epf)
372 {
373 unsigned long flags;
374 struct device *dev = epc->dev.parent;
^^^^^^^^^^^^^^^
Dereference.
375
376 if (epf->epc)
377 return -EBUSY;
378
379 if (IS_ERR(epc))
^^^^^^^^^^^
Can't be an error pointer or we would already have Oopsed.
380 return -EINVAL;
381
382 if (epf->func_no > epc->max_functions - 1)
383 return -EINVAL;
384
385 epf->epc = epc;
386 if (dev->of_node) {
387 of_dma_configure(&epf->dev, dev->of_node);
388 } else {
389 dma_set_coherent_mask(&epf->dev, epc->dev.coherent_dma_mask);
390 epf->dev.dma_mask = epc->dev.dma_mask;
391 }
392
393 spin_lock_irqsave(&epc->lock, flags);
394 list_add_tail(&epf->list, &epc->pci_epf);
395 spin_unlock_irqrestore(&epc->lock, flags);
396
397 return 0;
regards,
dan carpenter
reply other threads:[~2017-08-24 10:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20170824103742.ik3tcfa2fcgcdza4@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kishon@ti.com \
--cc=linux-pci@vger.kernel.org \
/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