Merge tag 'xtensa-20210902' of git://github.com/jcmvbkbc/linux-xtensa
[linux-2.6-microblaze.git] / arch / xtensa / platforms / iss / console.c
index 81f9889..81d7c7e 100644 (file)
@@ -199,10 +199,10 @@ late_initcall(rs_init);
 
 static void iss_console_write(struct console *co, const char *s, unsigned count)
 {
-       int len = strlen(s);
-
-       if (s != 0 && *s != 0)
+       if (s && *s != 0) {
+               int len = strlen(s);
                simc_write(1, s, count < len ? count : len);
+       }
 }
 
 static struct tty_driver* iss_console_device(struct console *c, int *index)