Loading drivers/edac/edac_pci.c +12 −13 Original line number Original line Diff line number Diff line Loading @@ -32,29 +32,28 @@ struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, const char *edac_pci_name) const char *edac_pci_name) { { struct edac_pci_ctl_info *pci; struct edac_pci_ctl_info *pci; void *p = NULL, *pvt; unsigned int size; edac_dbg(1, "\n"); edac_dbg(1, "\n"); pci = edac_align_ptr(&p, sizeof(*pci), 1); pci = kzalloc(sizeof(struct edac_pci_ctl_info), GFP_KERNEL); pvt = edac_align_ptr(&p, 1, sz_pvt); if (!pci) size = ((unsigned long)pvt) + sz_pvt; /* Alloc the needed control struct memory */ pci = kzalloc(size, GFP_KERNEL); if (pci == NULL) return NULL; return NULL; /* Now much private space */ if (sz_pvt) { pvt = sz_pvt ? ((char *)pci) + ((unsigned long)pvt) : NULL; pci->pvt_info = kzalloc(sz_pvt, GFP_KERNEL); if (!pci->pvt_info) goto free; } pci->pvt_info = pvt; pci->op_state = OP_ALLOC; pci->op_state = OP_ALLOC; snprintf(pci->name, strlen(edac_pci_name) + 1, "%s", edac_pci_name); snprintf(pci->name, strlen(edac_pci_name) + 1, "%s", edac_pci_name); return pci; return pci; free: kfree(pci); return NULL; } } EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info); EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info); Loading Loading
drivers/edac/edac_pci.c +12 −13 Original line number Original line Diff line number Diff line Loading @@ -32,29 +32,28 @@ struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, const char *edac_pci_name) const char *edac_pci_name) { { struct edac_pci_ctl_info *pci; struct edac_pci_ctl_info *pci; void *p = NULL, *pvt; unsigned int size; edac_dbg(1, "\n"); edac_dbg(1, "\n"); pci = edac_align_ptr(&p, sizeof(*pci), 1); pci = kzalloc(sizeof(struct edac_pci_ctl_info), GFP_KERNEL); pvt = edac_align_ptr(&p, 1, sz_pvt); if (!pci) size = ((unsigned long)pvt) + sz_pvt; /* Alloc the needed control struct memory */ pci = kzalloc(size, GFP_KERNEL); if (pci == NULL) return NULL; return NULL; /* Now much private space */ if (sz_pvt) { pvt = sz_pvt ? ((char *)pci) + ((unsigned long)pvt) : NULL; pci->pvt_info = kzalloc(sz_pvt, GFP_KERNEL); if (!pci->pvt_info) goto free; } pci->pvt_info = pvt; pci->op_state = OP_ALLOC; pci->op_state = OP_ALLOC; snprintf(pci->name, strlen(edac_pci_name) + 1, "%s", edac_pci_name); snprintf(pci->name, strlen(edac_pci_name) + 1, "%s", edac_pci_name); return pci; return pci; free: kfree(pci); return NULL; } } EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info); EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info); Loading