2021-11-19 09:12:12 +00:00
|
|
|
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
|
|
|
|
index c2869489ba68..7a46fc7a88f1 100644
|
|
|
|
--- a/drivers/tty/n_tty.c
|
|
|
|
+++ b/drivers/tty/n_tty.c
|
|
|
|
@@ -2295,7 +2295,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
|
2021-02-01 16:08:42 +00:00
|
|
|
* lock themselves)
|
|
|
|
*/
|
|
|
|
|
|
|
|
-static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
|
|
|
|
+static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file,
|
|
|
|
const unsigned char *buf, size_t nr)
|
|
|
|
{
|
|
|
|
const unsigned char *b = buf;
|
2021-11-19 09:12:12 +00:00
|
|
|
@@ -2382,6 +2382,13 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
|
2021-02-01 16:08:42 +00:00
|
|
|
return (b - buf) ? b - buf : retval;
|
|
|
|
}
|
|
|
|
|
2021-11-19 09:12:12 +00:00
|
|
|
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
2021-02-01 16:08:42 +00:00
|
|
|
+static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
|
|
|
|
+ const unsigned char *buf, size_t nr)
|
|
|
|
+{
|
|
|
|
+ return kpatch_n_tty_write(tty, file, buf, nr);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* n_tty_poll - poll method for N_TTY
|
|
|
|
* @tty: terminal device
|