nfsd4: fix minor memory leak
[safe/jmp/linux-2.6] / drivers / ssb / driver_pcicore.c
index d28c538..f1dcd79 100644 (file)
@@ -537,6 +537,13 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
        int err = 0;
        u32 tmp;
 
+       if (dev->bus->bustype != SSB_BUSTYPE_PCI) {
+               /* This SSB device is not on a PCI host-bus. So the IRQs are
+                * not routed through the PCI core.
+                * So we must not enable routing through the PCI core. */
+               goto out;
+       }
+
        if (!pdev)
                goto out;
        bus = pdev->bus;
@@ -544,13 +551,13 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
        might_sleep_if(pdev->id.coreid != SSB_DEV_PCI);
 
        /* Enable interrupts for this device. */
-       if (bus->host_pci &&
-           ((pdev->id.revision >= 6) || (pdev->id.coreid == SSB_DEV_PCIE))) {
+       if ((pdev->id.revision >= 6) || (pdev->id.coreid == SSB_DEV_PCIE)) {
                u32 coremask;
 
                /* Calculate the "coremask" for the device. */
                coremask = (1 << dev->core_index);
 
+               SSB_WARN_ON(bus->bustype != SSB_BUSTYPE_PCI);
                err = pci_read_config_dword(bus->host_pci, SSB_PCI_IRQMASK, &tmp);
                if (err)
                        goto out;