]> Pileus Git - ~andy/linux/blobdiff - drivers/edac/mce_amd_inj.c
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platf...
[~andy/linux] / drivers / edac / mce_amd_inj.c
index 8d0688f36d4cee2331c84fddb2848325badd849e..733a7e7a8d6fd4bdedb3d318cff78a506a0e3873 100644 (file)
@@ -88,10 +88,11 @@ static ssize_t edac_inject_bank_store(struct kobject *kobj,
                return -EINVAL;
        }
 
-       if (value > 5) {
-               printk(KERN_ERR "Non-existant MCE bank: %lu\n", value);
-               return -EINVAL;
-       }
+       if (value > 5)
+               if (boot_cpu_data.x86 != 0x15 || value > 6) {
+                       printk(KERN_ERR "Non-existant MCE bank: %lu\n", value);
+                       return -EINVAL;
+               }
 
        i_mce.bank = value;
 
@@ -139,7 +140,7 @@ static int __init edac_init_mce_inject(void)
        return 0;
 
 err_sysfs_create:
-       while (i-- >= 0)
+       while (--i >= 0)
                sysfs_remove_file(mce_kobj, &sysfs_attrs[i]->attr);
 
        kobject_del(mce_kobj);