diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2009-06-18 01:53:24 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-06-18 10:02:32 -0400 |
commit | b1f49f9582f9be6de5055cfa97eabf6246f2eaf7 (patch) | |
tree | ef4b56328278c36dc73557db9a8dcf0f5cc25693 /arch/x86 | |
parent | e92fae064ae42b2a4a77646f7655bca4c87bb1eb (diff) |
x86, mce: fix error path in mce_create_device()
Don't skip removing mce_attrs in route from error2.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Huang Ying <ying.huang@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index c2fb70d0286f..284d1de968bc 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -1798,7 +1798,7 @@ static cpumask_var_t mce_dev_initialized; | |||
1798 | static __cpuinit int mce_create_device(unsigned int cpu) | 1798 | static __cpuinit int mce_create_device(unsigned int cpu) |
1799 | { | 1799 | { |
1800 | int err; | 1800 | int err; |
1801 | int i; | 1801 | int i, j; |
1802 | 1802 | ||
1803 | if (!mce_available(&boot_cpu_data)) | 1803 | if (!mce_available(&boot_cpu_data)) |
1804 | return -EIO; | 1804 | return -EIO; |
@@ -1816,9 +1816,9 @@ static __cpuinit int mce_create_device(unsigned int cpu) | |||
1816 | if (err) | 1816 | if (err) |
1817 | goto error; | 1817 | goto error; |
1818 | } | 1818 | } |
1819 | for (i = 0; i < banks; i++) { | 1819 | for (j = 0; j < banks; j++) { |
1820 | err = sysdev_create_file(&per_cpu(mce_dev, cpu), | 1820 | err = sysdev_create_file(&per_cpu(mce_dev, cpu), |
1821 | &bank_attrs[i]); | 1821 | &bank_attrs[j]); |
1822 | if (err) | 1822 | if (err) |
1823 | goto error2; | 1823 | goto error2; |
1824 | } | 1824 | } |
@@ -1826,8 +1826,8 @@ static __cpuinit int mce_create_device(unsigned int cpu) | |||
1826 | 1826 | ||
1827 | return 0; | 1827 | return 0; |
1828 | error2: | 1828 | error2: |
1829 | while (--i >= 0) | 1829 | while (--j >= 0) |
1830 | sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[i]); | 1830 | sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[j]); |
1831 | error: | 1831 | error: |
1832 | while (--i >= 0) | 1832 | while (--i >= 0) |
1833 | sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]); | 1833 | sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]); |