EDAC, MCE: Fix edac_init_mce_inject error handling
authorAxel Lin <axel.lin@gmail.com>
Fri, 19 Nov 2010 03:05:43 +0000 (22:05 -0500)
committerBorislav Petkov <borislav.petkov@amd.com>
Mon, 22 Nov 2010 14:35:32 +0000 (15:35 +0100)
Otherwise, variable i will be -1 inside the latest iteration of the
while loop.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
drivers/edac/mce_amd_inj.c

index 8d0688f36d4cee2331c84fddb2848325badd849e..39faded3cadd6c753a9aecd5d4257a2bf12fa1c7 100644 (file)
@@ -139,7 +139,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);