Merge tag 'xtensa-20210902' of git://github.com/jcmvbkbc/linux-xtensa
[sfrench/cifs-2.6.git] / arch / xtensa / platforms / iss / console.c
index 81f988914d9a4e9504d21fbfb48b0934f6ee63f1..81d7c7e8f7e96077e2a26f69d173af19f28a5f18 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)