From 2896637b86243c39a4f08d15388dcc06130fff29 Mon Sep 17 00:00:00 2001 From: Hidetoshi Seto Date: Fri, 20 Aug 2010 04:28:51 -0300 Subject: [PATCH] i7core_edac: Call pci_dev_put() when alloc_i7core_dev() failed Signed-off-by: Hidetoshi Seto Signed-off-by: Mauro Carvalho Chehab --- drivers/edac/i7core_edac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 3542e8c0a63f..2e2db3c083ed 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -1384,8 +1384,10 @@ static int i7core_get_onedevice(struct pci_dev **prev, i7core_dev = get_i7core_dev(socket); if (!i7core_dev) { i7core_dev = alloc_i7core_dev(socket, table); - if (!i7core_dev) + if (!i7core_dev) { + pci_dev_put(pdev); return -ENOMEM; + } } if (i7core_dev->pdev[devno]) { -- 2.39.5