aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/sb105x
diff options
context:
space:
mode:
authorRashika Kheria <rashika.kheria@gmail.com>2013-10-20 18:29:55 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-25 06:34:21 +0100
commit7c64884b19f3dc864208df30c0a9c24175dac26a (patch)
tree7a283fbe2cbf28fcefd44bd752f25302f4185d42 /drivers/staging/sb105x
parentstaging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value (diff)
downloadlinux-dev-7c64884b19f3dc864208df30c0a9c24175dac26a.tar.xz
linux-dev-7c64884b19f3dc864208df30c0a9c24175dac26a.zip
Staging: sb105x: Fix a possible null dereference
This patch fixes the following error in sb_pc_mp.c- drivers/staging/sb105x/sb_pci_mp.c:546 mp_startup() error: we previously assumed 'info->tty' could be null (see line 525) Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sb105x')
-rw-r--r--drivers/staging/sb105x/sb_pci_mp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/sb105x/sb_pci_mp.c b/drivers/staging/sb105x/sb_pci_mp.c
index adb6bea728b2..bc53b4ef1e61 100644
--- a/drivers/staging/sb105x/sb_pci_mp.c
+++ b/drivers/staging/sb105x/sb_pci_mp.c
@@ -543,14 +543,14 @@ static int mp_startup(struct sb_uart_state *state, int init_hw)
if (init_hw) {
mp_change_speed(state, NULL);
- if (info->tty->termios.c_cflag & CBAUD)
+ if (info->tty && (info->tty->termios.c_cflag & CBAUD))
uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR);
}
info->flags |= UIF_INITIALIZED;
-
- clear_bit(TTY_IO_ERROR, &info->tty->flags);
+ if (info->tty)
+ clear_bit(TTY_IO_ERROR, &info->tty->flags);
}
if (retval && capable(CAP_SYS_ADMIN))