提交 1e358f94 编写于 作者: B Bjorn Helgaas

PCI: Fix use of uninitialized MPS value

If "pcie_bus_config == PCIE_BUS_PERFORMANCE", we don't initialize "smpss",
so we pass a pointer to garbage into pcie_bus_configure_set(), where we
compute "mps" based on the garbage.  We then pass the garbage "mps" to
pcie_write_mps(), which ignores it in the PCIE_BUS_PERFORMANCE case.

Coverity isn't smart enough to deduce that we ignore the garbage (it's a
lot to expect from a human, too), so initialize "smpss" to a safe value in
all cases.

Found by Coverity (CID 146454).
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 efdd4070
...@@ -1617,7 +1617,7 @@ static int pcie_bus_configure_set(struct pci_dev *dev, void *data) ...@@ -1617,7 +1617,7 @@ static int pcie_bus_configure_set(struct pci_dev *dev, void *data)
*/ */
void pcie_bus_configure_settings(struct pci_bus *bus) void pcie_bus_configure_settings(struct pci_bus *bus)
{ {
u8 smpss; u8 smpss = 0;
if (!bus->self) if (!bus->self)
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册