linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jingoo Han <jingoohan1@gmail.com>
Cc: linux-pci@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>
Subject: pci-exynos.c coverity issue #1437287
Date: Tue, 27 Oct 2020 11:34:46 -0500	[thread overview]
Message-ID: <20201027163446.GA184135@bjorn-Precision-5520> (raw)

Hi Jingoo,

Please take a look at this issue reported by Coverity:

222 static void exynos_pcie_assert_reset(struct exynos_pcie *ep)
223 {
224        struct dw_pcie *pci = ep->pci;
225        struct device *dev = pci->dev;
226
   	1. Condition ep->reset_gpio >= 0, taking true branch.
227        if (ep->reset_gpio >= 0)

CID 1437287 (#1 of 1): Unchecked return value (CHECKED_RETURN) 2.
check_return: Calling devm_gpio_request_one without checking return
value (as is done elsewhere 112 out of 113 times).

228                devm_gpio_request_one(dev, ep->reset_gpio,
229                                GPIOF_OUT_INIT_HIGH, "RESET");


Maybe you can guarantee that it's safe to ignore the return value by
doing a lot of code analysis, but I think it would be better to check
like all the other callers do.

             reply	other threads:[~2020-10-27 16:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 16:34 Bjorn Helgaas [this message]
2020-10-27 16:40 ` pci-exynos.c coverity issue #1437287 Krzysztof Kozlowski
2020-10-27 17:14   ` Bjorn Helgaas

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=20201027163446.GA184135@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-samsung-soc@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;
as well as URLs for NNTP newsgroup(s).