diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2010-01-07 21:27:30 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-18 10:45:20 -0400 |
commit | 2a6fae326713ec84f307c045f6b497d4afaeb1d4 (patch) | |
tree | 457bb87f51dfa4563ed5b9667a491beea23a7891 /drivers/edac | |
parent | 71753e0141a220ecbf9c71a66e0a8acce9705fb5 (diff) |
i7core_edac: fix memory leak of i7core_dev
Free already allocated i7core_dev.
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i7core_edac.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 37ade251e9e2..8e93df637bca 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1249,8 +1249,10 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno, | |||
1249 | return -ENOMEM; | 1249 | return -ENOMEM; |
1250 | i7core_dev->pdev = kzalloc(sizeof(*i7core_dev->pdev) * n_devs, | 1250 | i7core_dev->pdev = kzalloc(sizeof(*i7core_dev->pdev) * n_devs, |
1251 | GFP_KERNEL); | 1251 | GFP_KERNEL); |
1252 | if (!i7core_dev->pdev) | 1252 | if (!i7core_dev->pdev) { |
1253 | kfree(i7core_dev); | ||
1253 | return -ENOMEM; | 1254 | return -ENOMEM; |
1255 | } | ||
1254 | i7core_dev->socket = socket; | 1256 | i7core_dev->socket = socket; |
1255 | i7core_dev->n_devs = n_devs; | 1257 | i7core_dev->n_devs = n_devs; |
1256 | list_add_tail(&i7core_dev->list, &i7core_edac_list); | 1258 | list_add_tail(&i7core_dev->list, &i7core_edac_list); |