summaryrefslogtreecommitdiffstats
path: root/common/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index 4ca5f1809f..56bc864ad1 100644
--- a/common/console.c
+++ b/common/console.c
@@ -238,6 +238,9 @@ int getc(void)
unsigned char ch;
uint64_t start;
+ if (unlikely(!console_is_input_allow()))
+ return -EPERM;
+
/*
* For 100us we read the characters from the serial driver
* into a kfifo. This helps us not to lose characters
@@ -272,6 +275,9 @@ EXPORT_SYMBOL(fgetc);
int tstc(void)
{
+ if (unlikely(!console_is_input_allow()))
+ return 0;
+
return kfifo_len(console_input_fifo) || tstc_raw();
}
EXPORT_SYMBOL(tstc);