}
priv = hw->priv;
- priv->shrd = &priv->_shrd;
- bus->shrd = priv->shrd;
- priv->shrd->bus = bus;
+ priv->shrd = bus->shrd;
priv->shrd->priv = priv;
priv->shrd->trans = trans_ops->alloc(priv->shrd);
if (!bus) {
dev_printk(KERN_ERR, &pdev->dev,
"Couldn't allocate iwl_pci_bus");
+ return -ENOMEM;
+ }
+
+ bus->shrd = kzalloc(sizeof(*bus->shrd), GFP_KERNEL);
+ if (!bus->shrd) {
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Couldn't allocate iwl_shared");
err = -ENOMEM;
goto out_no_pci;
}
+ bus->shrd->bus = bus;
pci_bus = IWL_BUS_GET_PCI_BUS(bus);
pci_bus->pci_dev = pdev;
out_pci_disable_device:
pci_disable_device(pdev);
out_no_pci:
+ kfree(bus->shrd);
kfree(bus);
return err;
}
pci_disable_device(pci_dev);
pci_set_drvdata(pci_dev, NULL);
+ kfree(bus->shrd);
kfree(bus);
}