Skip to contentSkip to conversation

Fix gcc4 warning, file & fd may be used uninitialized in this function

PATCH New [email protected] 1 participant 1 message May 28, 2005 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Fix gcc4 warning, file & fd may be used uninitialized in this function

From: Jesse Millan <[email protected]>

This patch eliminates the warning that is generated when passing a reference of an uninitialized variable to a function where it possible that the function will return without initializing that variable.

---
 eventpoll.c |    3 +++
 1 files changed, 3 insertions(+)
fs/eventpoll.c +3 -0
Index: quilt/fs/eventpoll.c
===================================================================
@@ -748,6 +748,9 @@ eexit_3:
 eexit_2:
 	put_filp(file);
 eexit_1:
+	/* Reference went uninitialized. */
+	*efd = 0;
+	*efile = NULL;
 	return error;
 }
 

--