From 0d23ffb7fc4e23dbc6bd26752695b584b5cf4fe4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Jan 2014 05:11:47 -0800 Subject: [PATCH] 3.4-stable patches added patches: e752x_edac-fix-pci_dev-usage-count.patch --- .../e752x_edac-fix-pci_dev-usage-count.patch | 41 +++++++++++++++++++ queue-3.4/series | 1 + 2 files changed, 42 insertions(+) create mode 100644 queue-3.4/e752x_edac-fix-pci_dev-usage-count.patch diff --git a/queue-3.4/e752x_edac-fix-pci_dev-usage-count.patch b/queue-3.4/e752x_edac-fix-pci_dev-usage-count.patch new file mode 100644 index 00000000000..7274bb5f633 --- /dev/null +++ b/queue-3.4/e752x_edac-fix-pci_dev-usage-count.patch @@ -0,0 +1,41 @@ +From 90ed4988b8c030d65b41b7d13140e9376dc6ec5a Mon Sep 17 00:00:00 2001 +From: Aristeu Rozanski +Date: Thu, 5 Dec 2013 10:37:56 -0500 +Subject: e752x_edac: Fix pci_dev usage count + +From: Aristeu Rozanski + +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 +Reviewed-by: mark gross +Link: http://lkml.kernel.org/r/20131205153755.GL4545@redhat.com +Signed-off-by: Borislav Petkov +Cc: Jean Delvare +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/edac/e752x_edac.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/edac/e752x_edac.c ++++ b/drivers/edac/e752x_edac.c +@@ -1145,9 +1145,11 @@ static int e752x_get_devs(struct pci_dev + 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:" diff --git a/queue-3.4/series b/queue-3.4/series index bf6ff413e1e..e4aece9508a 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -1,2 +1,3 @@ md-raid5-fix-long-standing-problem-with-bitmap-handling-on-write-failure.patch mm-hugetlbfs-fix-hugetlbfs-optimization.patch +e752x_edac-fix-pci_dev-usage-count.patch -- 2.47.2