[3.5.y.z extended stable] Patch "e752x_edac: Fix pci_dev usage count" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Wed Feb 5 10:39:56 UTC 2014
This is a note to let you know that I have just added a patch titled
e752x_edac: Fix pci_dev usage count
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 5a53600da1af63b2e738c442019d381556390d79 Mon Sep 17 00:00:00 2001
From: Aristeu Rozanski <aris at redhat.com>
Date: Thu, 5 Dec 2013 10:37:56 -0500
Subject: e752x_edac: Fix pci_dev usage count
commit 90ed4988b8c030d65b41b7d13140e9376dc6ec5a upstream.
In case the device 0, function 1 is not found using pci_get_device(),
pci_scan_single_device() will be used but, differently than
pci_get_device(), it allocates a pci_dev but doesn't does bump the usage
count on the pci_dev and after few module removals and loads the pci_dev
will be freed.
Signed-off-by: Aristeu Rozanski <aris at redhat.com>
Reviewed-by: mark gross <mark.gross at intel.com>
Link: http://lkml.kernel.org/r/20131205153755.GL4545@redhat.com
Signed-off-by: Borislav Petkov <bp at suse.de>
Cc: Jean Delvare <jdelvare at suse.de>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/edac/e752x_edac.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 3186512..847f248 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -1182,9 +1182,11 @@ static int e752x_get_devs(struct pci_dev *pdev, int dev_idx,
pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
pvt->dev_info->err_dev, pvt->bridge_ck);
- if (pvt->bridge_ck == NULL)
+ if (pvt->bridge_ck == NULL) {
pvt->bridge_ck = pci_scan_single_device(pdev->bus,
PCI_DEVFN(0, 1));
+ pci_dev_get(pvt->bridge_ck);
+ }
if (pvt->bridge_ck == NULL) {
e752x_printk(KERN_ERR, "error reporting device not found:"
--
1.8.3.2
More information about the kernel-team
mailing list