[1/3] insert_resource can succeed and return an error

From: Matthew Wilcox <willy_at_debian.org>
Date: 2004-03-19 10:51:37
If we start again, we can return an error even if we were successful.
Reset the result to 0 before beginning again.  Why don't we use a
tailcall here?

Index: kernel/resource.c
===================================================================
RCS file: /var/cvs/linux-2.6/kernel/resource.c,v
retrieving revision 1.12
diff -u -p -r1.12 resource.c
--- a/kernel/resource.c	28 Feb 2004 01:51:35 -0000	1.12
+++ b/kernel/resource.c	18 Mar 2004 23:41:01 -0000
@@ -337,6 +337,7 @@ int insert_resource(struct resource *par
 	/* existing resource overlaps end of new resource */
 	if (next->end > new->end) {
 		parent = next;
+		result = 0;
 		goto begin;
 	}
 

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Mar 18 18:59:11 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:24 EST