tty: fix data race in flush_to_ldisc
[firefly-linux-kernel-4.4.55.git] / drivers / tty / tty_buffer.c
index 5a3fa89138801ea63907ec102fbb589b36d7201c..23de97de09a4d9ca0c9885b2a34949a713ec7f3b 100644 (file)
@@ -467,7 +467,7 @@ static void flush_to_ldisc(struct work_struct *work)
        struct tty_struct *tty;
        struct tty_ldisc *disc;
 
-       tty = port->itty;
+       tty = READ_ONCE(port->itty);
        if (tty == NULL)
                return;