提交 a4f63634 编写于 作者: B Betty Dall 提交者: David S. Miller

atl1c: Check return from pci_find_ext_capability() in atl1c_reset_pcie()

The function atl1c_reset_pcie() does not check the return from
pci_find_ext_cabability() where it is getting the postion of the
PCI_EXT_CAP_ID_ERR. It is possible for the return to be 0.
Signed-off-by: NBetty Dall <betty.dall@hp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 24f5b855
......@@ -145,9 +145,11 @@ static void atl1c_reset_pcie(struct atl1c_hw *hw, u32 flag)
* Mask some pcie error bits
*/
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR);
if (pos) {
pci_read_config_dword(pdev, pos + PCI_ERR_UNCOR_SEVER, &data);
data &= ~(PCI_ERR_UNC_DLP | PCI_ERR_UNC_FCP);
pci_write_config_dword(pdev, pos + PCI_ERR_UNCOR_SEVER, data);
}
/* clear error status */
pcie_capability_write_word(pdev, PCI_EXP_DEVSTA,
PCI_EXP_DEVSTA_NFED |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册