diff --git a/common/console.c b/common/console.c
index 1177f7d..831897b 100644
--- a/common/console.c
+++ b/common/console.c
@@ -1,4 +1,6 @@
 /*
+ * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+ *
  * (C) Copyright 2000
  * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
  *
@@ -622,6 +624,7 @@ int console_init_r(void)
 {
 	char *stdinname, *stdoutname, *stderrname;
 	struct stdio_dev *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
+	int overwrite_console_retval;
 #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
 	int i;
 #endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
@@ -636,13 +639,19 @@ int console_init_r(void)
 	gd->jt[XF_puts] = serial_puts;
 	gd->jt[XF_printf] = serial_printf;
 
-	/* stdin stdout and stderr are in environment */
-	/* scan for it */
+	/*
+	 * stdin stdout and stderr are in environment.
+	 * Call OVERWRITE_CONSOLE function before scanning for stdio, stdout,
+	 * stderr to get latest pointer after update.
+	 * (getenv() returns NULL if var not present)
+	 */
+	overwrite_console_retval = OVERWRITE_CONSOLE;
 	stdinname  = getenv("stdin");
 	stdoutname = getenv("stdout");
 	stderrname = getenv("stderr");
 
-	if (OVERWRITE_CONSOLE == 0) {	/* if not overwritten by config switch */
+	/* if not overwritten by config switch */
+	if (overwrite_console_retval == 0) {
 		inputdev  = search_device(DEV_FLAGS_INPUT,  stdinname);
 		outputdev = search_device(DEV_FLAGS_OUTPUT, stdoutname);
 		errdev    = search_device(DEV_FLAGS_OUTPUT, stderrname);
