From: Axel Lin Date: Fri, 19 Nov 2010 03:05:43 +0000 (-0500) Subject: EDAC, MCE: Fix edac_init_mce_inject error handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=df4b2a30e0b9e553abfd63ee75dbbd66be80f01a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git EDAC, MCE: Fix edac_init_mce_inject error handling Otherwise, variable i will be -1 inside the latest iteration of the while loop. Signed-off-by: Axel Lin Signed-off-by: Borislav Petkov --- diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c index 8d0688f36d4c..39faded3cadd 100644 --- a/drivers/edac/mce_amd_inj.c +++ b/drivers/edac/mce_amd_inj.c @@ -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);