Commit e7027075 authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by John W. Linville

bcma: fix null pointer in bcma_core_pci_irq_ctl

pc could be null if hosttype != BCMA_HOSTTYPE_PCI.
If we are on a device without a pci core this function is called with
pc = null by b43 and brcmsmac. If the host type is PCI we have a pci
core as well and pc can not be null.
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e64add27
...@@ -232,17 +232,19 @@ void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc) ...@@ -232,17 +232,19 @@ void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc)
int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
bool enable) bool enable)
{ {
struct pci_dev *pdev = pc->core->bus->host_pci; struct pci_dev *pdev;
u32 coremask, tmp; u32 coremask, tmp;
int err = 0; int err = 0;
if (core->bus->hosttype != BCMA_HOSTTYPE_PCI) { if (!pc || core->bus->hosttype != BCMA_HOSTTYPE_PCI) {
/* This bcma device is not on a PCI host-bus. So the IRQs are /* This bcma device is not on a PCI host-bus. So the IRQs are
* not routed through the PCI core. * not routed through the PCI core.
* So we must not enable routing through the PCI core. */ * So we must not enable routing through the PCI core. */
goto out; goto out;
} }
pdev = pc->core->bus->host_pci;
err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
if (err) if (err)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment