diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mxser.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index d5c34af8752d..3b965a651da4 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -917,6 +917,9 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) | |||
917 | struct mxser_struct *info; | 917 | struct mxser_struct *info; |
918 | int retval, line; | 918 | int retval, line; |
919 | 919 | ||
920 | /* initialize driver_data in case something fails */ | ||
921 | tty->driver_data = NULL; | ||
922 | |||
920 | line = tty->index; | 923 | line = tty->index; |
921 | if (line == MXSER_PORTS) | 924 | if (line == MXSER_PORTS) |
922 | return 0; | 925 | return 0; |
@@ -979,7 +982,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) | |||
979 | if (tty->index == MXSER_PORTS) | 982 | if (tty->index == MXSER_PORTS) |
980 | return; | 983 | return; |
981 | if (!info) | 984 | if (!info) |
982 | BUG(); | 985 | return; |
983 | 986 | ||
984 | spin_lock_irqsave(&info->slock, flags); | 987 | spin_lock_irqsave(&info->slock, flags); |
985 | 988 | ||