Skip to contentSkip to conversation

New Defects reported by Coverity Scan for Linux

DISCUSSION Bjorn Helgaas 3 participants 3 messages Jul 23, 2018 – Jul 25, 2018 1 message not in the archive PCI

lore
Share & tools
lore

Bjorn Helgaas

author maintainer
#1 lore raw
In reply to a message not in the archive

Hi Honghui,

Would you consider doing a minor patch to fix the issue Coverity reported below (not checking the return value from devm_pci_remap_iospace())?

Thanks,
Bjorn

---------- Forwarded message ---------
From: <[email protected]>
Date: Sun, Jul 22, 2018 at 11:13 PM
Subject: New Defects reported by Coverity Scan for Linux
To: <[email protected]>

...
** CID 1438089: Error handling issues (CHECKED_RETURN) /drivers/pci/controller/pcie-mediatek.c: 1112 in mtk_pcie_request_resources()

________________________________________________________________________________________________________
*** CID 1438089: Error handling issues (CHECKED_RETURN) /drivers/pci/controller/pcie-mediatek.c: 1112 in mtk_pcie_request_resources()
1106 pci_add_resource(windows, &pcie->busn);
1107
1108 err = devm_request_pci_bus_resources(dev, windows);
1109 if (err < 0)
1110 return err;
1111

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1438089: Error handling issues (CHECKED_RETURN)
Calling "devm_pci_remap_iospace" without checking return value (as is done elsewhere 5 out of 6 times).

1112 devm_pci_remap_iospace(dev, &pcie->pio, pcie->io.start);
1113
1114 return 0;
1115 }
1116
1117 static int mtk_pcie_register_host(struct pci_host_bridge *host)

#2 lore raw

[+cc Gustavo]

Quoted 5 lines · Bjorn Helgaas

Hi Honghui,

Would you consider doing a minor patch to fix the issue Coverity reported below (not checking the return value from devm_pci_remap_iospace())?

Never mind, I see Gustavo has already posted such a patch:

https://lkml.kernel.org/r/[email protected]

Thanks, Gustavo!

Quoted 28 lines

---------- Forwarded message ---------
From: <[email protected]>
Date: Sun, Jul 22, 2018 at 11:13 PM
Subject: New Defects reported by Coverity Scan for Linux
To: <[email protected]>

...
** CID 1438089: Error handling issues (CHECKED_RETURN) /drivers/pci/controller/pcie-mediatek.c: 1112 in mtk_pcie_request_resources()

________________________________________________________________________________________________________
*** CID 1438089: Error handling issues (CHECKED_RETURN) /drivers/pci/controller/pcie-mediatek.c: 1112 in mtk_pcie_request_resources()
1106 pci_add_resource(windows, &pcie->busn);
1107
1108 err = devm_request_pci_bus_resources(dev, windows);
1109 if (err < 0)
1110 return err;
1111

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1438089: Error handling issues (CHECKED_RETURN)
Calling "devm_pci_remap_iospace" without checking return value (as is done elsewhere 5 out of 6 times).

1112 devm_pci_remap_iospace(dev, &pcie->pio, pcie->io.start);
1113
1114 return 0;
1115 }
1116
1117 static int mtk_pcie_register_host(struct pci_host_bridge *host)

#3 lore raw
Quoted 9 lines · Bjorn Helgaas

[+cc Gustavo]

Quoted 5 lines · Bjorn Helgaas

Hi Honghui,

Would you consider doing a minor patch to fix the issue Coverity reported below (not checking the return value from devm_pci_remap_iospace())?

Quoted 6 lines

Never mind, I see Gustavo has already posted such a patch:

https://lkml.kernel.org/r/[email protected]

Thanks, Gustavo!

Glad to help. :)

Thanks
--
Gustavo