diff options
-rw-r--r-- | drivers/char/tty_ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 58597993954f..f19cf9d7792d 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c | |||
@@ -476,11 +476,11 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, | |||
476 | ld = tty_ldisc_ref(tty); | 476 | ld = tty_ldisc_ref(tty); |
477 | switch (arg) { | 477 | switch (arg) { |
478 | case TCIFLUSH: | 478 | case TCIFLUSH: |
479 | if (ld->flush_buffer) | 479 | if (ld && ld->flush_buffer) |
480 | ld->flush_buffer(tty); | 480 | ld->flush_buffer(tty); |
481 | break; | 481 | break; |
482 | case TCIOFLUSH: | 482 | case TCIOFLUSH: |
483 | if (ld->flush_buffer) | 483 | if (ld && ld->flush_buffer) |
484 | ld->flush_buffer(tty); | 484 | ld->flush_buffer(tty); |
485 | /* fall through */ | 485 | /* fall through */ |
486 | case TCOFLUSH: | 486 | case TCOFLUSH: |