From b1d105082bee1e2dd41d9b882979e04f20ac9bbd Mon Sep 17 00:00:00 2001
From: Alberto Bertogli <albertito@blitiri.com.ar>
Date: Sat, 13 Jun 2009 00:53:40 -0300
Subject: [PATCH 14/48] Make fiu_disable() cope with empty enabled_fails

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
---
 libfiu/fiu.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libfiu/fiu.c b/libfiu/fiu.c
index cb1d8de..dad5803 100644
--- a/libfiu/fiu.c
+++ b/libfiu/fiu.c
@@ -421,6 +421,12 @@ int fiu_disable(const char *name)
 	/* just find the point of failure and mark it as free by setting its
 	 * name to NULL */
 	ef_wlock();
+
+	if (enabled_fails == NULL) {
+		ef_wunlock();
+		return -1;
+	}
+
 	for (pf = enabled_fails; pf <= enabled_fails_last; pf++) {
 		if (name_matches(pf, name, 1)) {
 			disable_pf(pf);
-- 
1.6.2.2.646.gb214

