brcm47xx: bcma: fix null pointer
[openwrt.git] / target / linux / brcm47xx / patches-3.3 / 233-bcma-fix-NP-in-bcma_core_pci_irq_ctl.patch
1 --- a/drivers/bcma/driver_pci.c
2 +++ b/drivers/bcma/driver_pci.c
3 @@ -232,7 +232,7 @@ void __devinit bcma_core_pci_init(struct
4  int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
5                           bool enable)
6  {
7 -       struct pci_dev *pdev = pc->core->bus->host_pci;
8 +       struct pci_dev *pdev;
9         u32 coremask, tmp;
10         int err = 0;
11  
12 @@ -243,6 +243,8 @@ int bcma_core_pci_irq_ctl(struct bcma_dr
13                 goto out;
14         }
15  
16 +       pdev = pc->core->bus->host_pci;
17 +
18         err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
19         if (err)
20                 goto out;