[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1335765538-30399-1-git-send-email-Julia.Lawall@lip6.fr>
Date: Mon, 30 Apr 2012 07:58:58 +0200
From: Julia Lawall <Julia.Lawall@...6.fr>
To: Doug Thompson <dougthompson@...ssion.com>
Cc: kernel-janitors@...r.kernel.org, linux-edac@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drivers/edac/i3200_edac.c: add missing iounmap
From: Julia Lawall <Julia.Lawall@...6.fr>
Add iounmap in the case where window has already been allocated.
Reorganize the error handling code at the end of the function so that if is
not needed.
Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>
---
drivers/edac/i3200_edac.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c
index 046808c..55c4336 100644
--- a/drivers/edac/i3200_edac.c
+++ b/drivers/edac/i3200_edac.c
@@ -338,8 +338,10 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
mci = edac_mc_alloc(sizeof(struct i3200_priv), I3200_RANKS,
nr_channels, 0);
- if (!mci)
- return -ENOMEM;
+ if (!mci) {
+ rc = -ENOMEM;
+ goto fail_alloc;
+ }
debugf3("MC: %s(): init mci\n", __func__);
@@ -404,9 +406,9 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
return 0;
fail:
+ edac_mc_free(mci);
+fail_alloc:
iounmap(window);
- if (mci)
- edac_mc_free(mci);
return rc;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists