[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191121194043.22378-1-navid.emamdoost@gmail.com>
Date: Thu, 21 Nov 2019 13:40:41 -0600
From: Navid Emamdoost <navid.emamdoost@...il.com>
To: Borislav Petkov <bp@...en8.de>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Tony Luck <tony.luck@...el.com>,
James Morse <james.morse@....com>,
Robert Richter <rrichter@...vell.com>,
linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: emamd001@....edu, Navid Emamdoost <navid.emamdoost@...il.com>
Subject: [PATCH] EDAC: Fix memory leak in i5100_init_one
In the implementation of i5100_init_one(), the allocated mci is not
correctly released in cases of failure. The release via edac_mc_free()
should be reached by label bail_einj and subsequents.
Fixes: 52608ba20546 ("i5100_edac: probe for device 19 function 0")
Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
---
drivers/edac/i5100_edac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c
index 251f2b692785..710fabd5fba1 100644
--- a/drivers/edac/i5100_edac.c
+++ b/drivers/edac/i5100_edac.c
@@ -1149,12 +1149,12 @@ static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
bail_scrub:
priv->scrub_enable = 0;
cancel_delayed_work_sync(&(priv->i5100_scrubbing));
- edac_mc_free(mci);
bail_disable_einj:
pci_disable_device(einj);
bail_einj:
+ edac_mc_free(mci);
pci_dev_put(einj);
bail_disable_ch1:
--
2.17.1
Powered by blists - more mailing lists