diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2010-08-20 03:28:40 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-24 09:20:40 -0400 |
commit | 628c5ddfb08094a5ef9186dc866d09bfcac105c9 (patch) | |
tree | 49bd3550e4d8e89bcf3ffe70b1a53b283f439bd7 /drivers | |
parent | 5939813b9c4270d0f46375c3cad64226bb1fcd62 (diff) |
i7core_edac: Fix error path of i7core_register_mci
Release resources properly.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/edac/i7core_edac.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 6bebf4d73f48..3542e8c0a63f 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1954,7 +1954,7 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev, | |||
1954 | /* Store pci devices at mci for faster access */ | 1954 | /* Store pci devices at mci for faster access */ |
1955 | rc = mci_bind_devs(mci, i7core_dev); | 1955 | rc = mci_bind_devs(mci, i7core_dev); |
1956 | if (unlikely(rc < 0)) | 1956 | if (unlikely(rc < 0)) |
1957 | goto fail; | 1957 | goto fail0; |
1958 | 1958 | ||
1959 | if (pvt->is_registered) | 1959 | if (pvt->is_registered) |
1960 | mci->mc_driver_sysfs_attributes = i7core_sysfs_rdimm_attrs; | 1960 | mci->mc_driver_sysfs_attributes = i7core_sysfs_rdimm_attrs; |
@@ -1977,7 +1977,7 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev, | |||
1977 | */ | 1977 | */ |
1978 | 1978 | ||
1979 | rc = -EINVAL; | 1979 | rc = -EINVAL; |
1980 | goto fail; | 1980 | goto fail0; |
1981 | } | 1981 | } |
1982 | 1982 | ||
1983 | /* Default error mask is any memory */ | 1983 | /* Default error mask is any memory */ |
@@ -1998,11 +1998,17 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev, | |||
1998 | if (unlikely(rc < 0)) { | 1998 | if (unlikely(rc < 0)) { |
1999 | debugf0("MC: " __FILE__ | 1999 | debugf0("MC: " __FILE__ |
2000 | ": %s(): failed edac_mce_register()\n", __func__); | 2000 | ": %s(): failed edac_mce_register()\n", __func__); |
2001 | goto fail1; | ||
2001 | } | 2002 | } |
2002 | 2003 | ||
2003 | fail: | 2004 | return 0; |
2004 | if (rc < 0) | 2005 | |
2005 | edac_mc_free(mci); | 2006 | fail1: |
2007 | i7core_pci_ctl_release(pvt); | ||
2008 | edac_mc_del_mc(mci->dev); | ||
2009 | fail0: | ||
2010 | kfree(mci->ctl_name); | ||
2011 | edac_mc_free(mci); | ||
2006 | return rc; | 2012 | return rc; |
2007 | } | 2013 | } |
2008 | 2014 | ||