Sophie

Sophie

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

kernel-2.6.18-238.el5.src.rpm

From: Mauro Carvalho Chehab <mchehab@redhat.com>
Date: Tue, 23 Nov 2010 17:33:50 -0500
Subject: [edac] i7core_edac: fix the logic in i7core_remove
Message-id: <20101123153350.3797a487@pedra>
Patchwork-id: 29566
O-Subject: [PATCH RHEL5 10/29] BZ#:651869 i7core_edac: Fix the logic in
	i7core_remove()
Bugzilla: 651869
RH-Acked-by: Aristeu Rozanski <aris@redhat.com>

Changeset: 45b7c981aeeb456d4b0c04f15d551f3e515bf20e

commit 47251b4d960bdfa648b0d06dbc6d445f41cb3906 have changed
the logic for unexplained reasons.  It looks strange that it
can release i7core_dev without calling i7core_put_devices()
that releases i7core_dev->pdev.

Fix the part.

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 515c982..4d19883 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -2082,9 +2082,9 @@ static void __devexit i7core_remove(struct pci_dev *pdev)
 
 			/* Release PCI resources */
 			i7core_put_devices(i7core_dev);
+			list_del(&i7core_dev->list);
+			kfree(i7core_dev);
 		}
-		list_del(&i7core_dev->list);
-		kfree(i7core_dev);
 	}
 	probed--;