[PATCH V2] tty: fix data race between tty_init_dev and flush of buf

2018-01-22 Thread Gaurav Kohli
There can be a race, if receive_buf call comes before tty initialization completes in n_tty_open and tty->disc_data may be NULL. CPU0CPU1 000|n_tty_receive_buf_common() n_tty_open() -001|n_tty_receive_buf2()

[PATCH V2] tty: fix data race between tty_init_dev and flush of buf

2018-01-22 Thread Gaurav Kohli
There can be a race, if receive_buf call comes before tty initialization completes in n_tty_open and tty->disc_data may be NULL. CPU0CPU1 000|n_tty_receive_buf_common() n_tty_open() -001|n_tty_receive_buf2()