[PATCH] fix warning in fs/ocfs2/stack_user.c

From: Ingo Molnar
Date: Tue Nov 25 2008 - 07:14:19 EST

this warning:

fs/ocfs2/stack_user.c: In function âuser_cluster_connectâ:
fs/ocfs2/stack_user.c:807: warning: âcontrolâ may be used uninitialized in this function

triggers because GCC does not recognize the (correct) error flow

- ocfs2_live_connection_new() and 'control'

Annotate it.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
fs/ocfs2/stack_user.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index faec2d8..55e2cdc 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -804,7 +804,7 @@ static int fs_protocol_compare(struct ocfs2_protocol_version *existing,
static int user_cluster_connect(struct ocfs2_cluster_connection *conn)
dlm_lockspace_t *fsdlm;
- struct ocfs2_live_connection *control;
+ struct ocfs2_live_connection *uninitialized_var(control);
int rc = 0;

BUG_ON(conn == NULL);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/