mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/9] console: Fix possible null pointer dereference
@ 2013-04-26 16:41 Alexander Shiyan
  2013-04-26 16:41 ` [PATCH 2/9] ARM: at91 gpio: " Alexander Shiyan
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Alexander Shiyan @ 2013-04-26 16:41 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 common/console.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/common/console.c b/common/console.c
index beb37bd..965be03 100644
--- a/common/console.c
+++ b/common/console.c
@@ -62,23 +62,23 @@ static int console_std_set(struct device_d *dev, struct param_d *param,
 	char active[4];
 	unsigned int flag = 0, i = 0;
 
-	if (!val)
-		dev_param_set_generic(dev, param, NULL);
-
-	if (strchr(val, 'i') && cdev->f_caps & CONSOLE_STDIN) {
-		active[i++] = 'i';
-		flag |= CONSOLE_STDIN;
-	}
+	if (val) {
+		if (strchr(val, 'i') && cdev->f_caps & CONSOLE_STDIN) {
+			active[i++] = 'i';
+			flag |= CONSOLE_STDIN;
+		}
 
-	if (strchr(val, 'o') && cdev->f_caps & CONSOLE_STDOUT) {
-		active[i++] = 'o';
-		flag |= CONSOLE_STDOUT;
-	}
+		if (strchr(val, 'o') && cdev->f_caps & CONSOLE_STDOUT) {
+			active[i++] = 'o';
+			flag |= CONSOLE_STDOUT;
+		}
 
-	if (strchr(val, 'e') && cdev->f_caps & CONSOLE_STDERR) {
-		active[i++] = 'e';
-		flag |= CONSOLE_STDERR;
-	}
+		if (strchr(val, 'e') && cdev->f_caps & CONSOLE_STDERR) {
+			active[i++] = 'e';
+			flag |= CONSOLE_STDERR;
+		}
+	} else
+		dev_param_set_generic(dev, param, NULL);
 
 	active[i] = 0;
 	cdev->f_active = flag;
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-04-30  7:47 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-26 16:41 [PATCH 1/9] console: Fix possible null pointer dereference Alexander Shiyan
2013-04-26 16:41 ` [PATCH 2/9] ARM: at91 gpio: " Alexander Shiyan
2013-04-26 16:59   ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-26 20:48     ` Sascha Hauer
2013-04-26 16:41 ` [PATCH 3/9] ARM: at91 smc: Fix possible uninitialized variable Alexander Shiyan
2013-04-26 16:59   ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-26 17:09     ` Re[2]: " Alexander Shiyan
2013-04-26 20:49       ` Sascha Hauer
2013-04-26 16:41 ` [PATCH 4/9] MCI: atmel: Fix possible null pointer dereference Alexander Shiyan
2013-04-26 16:41 ` [PATCH 5/9] MCI: imx-esdhc: " Alexander Shiyan
2013-04-26 20:54   ` Sascha Hauer
2013-04-27  4:45     ` Re[2]: " Alexander Shiyan
2013-04-26 16:41 ` [PATCH 6/9] MCI: imx: " Alexander Shiyan
2013-04-26 16:41 ` [PATCH 7/9] NAND: imx: Fix memory leak Alexander Shiyan
2013-04-26 16:41 ` [PATCH 8/9] Serial: mpc5xxx: Fix setup mode at port initialization Alexander Shiyan
2013-04-30  7:39   ` Sascha Hauer
2013-04-30  7:46     ` Re[2]: " Alexander Shiyan
2013-04-26 16:41 ` [PATCH 9/9] MCI: imx-esdhc: Remove now unneeded check Alexander Shiyan
2013-04-26 20:57   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox