Skip to contentSkip to conversation

pci-exynos.c coverity issue #1437287

DISCUSSION Bjorn Helgaas 2 participants 3 messages Oct 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore 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.

#1 lore raw
Quoted 16 lines · Bjorn Helgaas

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).

Quoted 7 lines

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.

+Cc Marek,

Hi Bjorn,

I think this is being removed by Marek's patchset:
https://lore.kernel.org/linux-samsung-soc/[email protected]/

Best regards,
Krzysztof

#2 lore raw
Quoted 25 lines · Krzysztof Kozlowski
Quoted 16 lines · Bjorn Helgaas

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).

Quoted 7 lines

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.

Quoted 6 lines

+Cc Marek,

Hi Bjorn,

I think this is being removed by Marek's patchset:
https://lore.kernel.org/linux-samsung-soc/[email protected]/

Perfect, thanks!