Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217373
b: refs/heads/master
c: 848b2f7
h: refs/heads/master
i:
  217371: 988f389
v: v3
  • Loading branch information
Hidetoshi Seto authored and Mauro Carvalho Chehab committed Oct 24, 2010
1 parent f7141d2 commit 32be69c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b197cba071ec8a171fbaaaf82d119315a6f6cb0b
refs/heads/master: 848b2f7ed6db4d3a83201187159665cc57725d9f
34 changes: 24 additions & 10 deletions trunk/drivers/edac/i7core_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,29 @@ static struct i7core_dev *get_i7core_dev(u8 socket)
return NULL;
}

static struct i7core_dev *alloc_i7core_dev(u8 socket,
const struct pci_id_table *table)
{
struct i7core_dev *i7core_dev;

i7core_dev = kzalloc(sizeof(*i7core_dev), GFP_KERNEL);
if (!i7core_dev)
return NULL;

i7core_dev->pdev = kzalloc(sizeof(*i7core_dev->pdev) * table->n_devs,
GFP_KERNEL);
if (!i7core_dev->pdev) {
kfree(i7core_dev);
return NULL;
}

i7core_dev->socket = socket;
i7core_dev->n_devs = table->n_devs;
list_add_tail(&i7core_dev->list, &i7core_edac_list);

return i7core_dev;
}

/****************************************************************************
Memory check routines
****************************************************************************/
Expand Down Expand Up @@ -1355,18 +1378,9 @@ static int i7core_get_onedevice(struct pci_dev **prev,

i7core_dev = get_i7core_dev(socket);
if (!i7core_dev) {
i7core_dev = kzalloc(sizeof(*i7core_dev), GFP_KERNEL);
i7core_dev = alloc_i7core_dev(socket, table);
if (!i7core_dev)
return -ENOMEM;
i7core_dev->pdev = kzalloc(sizeof(*i7core_dev->pdev)
* table->n_devs, GFP_KERNEL);
if (!i7core_dev->pdev) {
kfree(i7core_dev);
return -ENOMEM;
}
i7core_dev->socket = socket;
i7core_dev->n_devs = table->n_devs;
list_add_tail(&i7core_dev->list, &i7core_edac_list);
}

if (i7core_dev->pdev[devno]) {
Expand Down

0 comments on commit 32be69c

Please sign in to comment.