Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 781

kernel-2.6.18-238.el5.src.rpm

From: Mauro Carvalho Chehab <mchehab@redhat.com>
Date: Tue, 23 Nov 2010 17:33:56 -0500
Subject: [edac] i7core_edac: call pci_dev_put on alloc failure
Message-id: <20101123153356.483c6da9@pedra>
Patchwork-id: 29573
O-Subject: [PATCH RHEL5 18/29] BZ#:651869 i7core_edac: Call pci_dev_put() when
	alloc_i7core_dev()  failed
Bugzilla: 651869
RH-Acked-by: Aristeu Rozanski <aris@redhat.com>

Changeset: 2896637b86243c39a4f08d15388dcc06130fff29

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>

diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 33f870c..5aa3ac9 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1385,8 +1385,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]) {