Skip to contentSkip to conversation

EDAC, MCE: Fix edac_init_mce_inject error handling

PATCH Applied Axel Lin 2 participants 2 messages Nov 19, 2010

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 EDAC, MCE: Fix edac_init_mce_inject error handling

Otherwise, variable i will be -1 inside the latest iteration of the while loop.

---
 drivers/edac/mce_amd_inj.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/edac/mce_amd_inj.c +1 -1
index 6db494f..733a7e7 100644
@@ -140,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);
Signature · 1 line
1.7.2
#1 lore raw
Quoted 3 lines · Axel Lin

Otherwise, variable i will be -1 inside the latest iteration of the while loop.

Good catch.

Applied,
thanks.

Signature · 8 lines
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632