return i7core_dev;
}
+static void free_i7core_dev(struct i7core_dev *i7core_dev)
+{
+ list_del(&i7core_dev->list);
+ kfree(i7core_dev->pdev);
+ kfree(i7core_dev);
+}
+
/****************************************************************************
Memory check routines
****************************************************************************/
PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
pci_dev_put(pdev);
}
- kfree(i7core_dev->pdev);
}
static void i7core_put_all_devices(void)
list_for_each_entry_safe(i7core_dev, tmp, &i7core_edac_list, list) {
i7core_put_devices(i7core_dev);
- list_del(&i7core_dev->list);
- kfree(i7core_dev);
+ free_i7core_dev(i7core_dev);
}
}
/* Release PCI resources */
i7core_put_devices(i7core_dev);
- list_del(&i7core_dev->list);
- kfree(i7core_dev);
+ free_i7core_dev(i7core_dev);
}
}
probed--;