summaryrefslogtreecommitdiffstats
path: root/drivers/staging/sb105x
diff options
context:
space:
mode:
authorDan Carpenter2013-01-09 08:10:59 +0100
committerGreg Kroah-Hartman2013-01-18 01:43:20 +0100
commit8441bf5e063e03e5d307ffb32fd5f77e81c0d397 (patch)
tree0171af80aa59c11eebf66ff43cbec41fac84aae7 /drivers/staging/sb105x
parentstaging: slicoss: Fix space-related checkpatch.pl warnings (diff)
downloadkernel-qcow2-linux-8441bf5e063e03e5d307ffb32fd5f77e81c0d397.tar.gz
kernel-qcow2-linux-8441bf5e063e03e5d307ffb32fd5f77e81c0d397.tar.xz
kernel-qcow2-linux-8441bf5e063e03e5d307ffb32fd5f77e81c0d397.zip
staging: sb105x: move dereference under IS_ERR() check
Avoid dereverencing the ERR_PTR() by shifting the dereference down a couple lines. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sb105x')
-rw-r--r--drivers/staging/sb105x/sb_pci_mp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/sb105x/sb_pci_mp.c b/drivers/staging/sb105x/sb_pci_mp.c
index 131afd0c460c..c34ebff6bb04 100644
--- a/drivers/staging/sb105x/sb_pci_mp.c
+++ b/drivers/staging/sb105x/sb_pci_mp.c
@@ -1563,13 +1563,13 @@ static int mp_open(struct tty_struct *tty, struct file *filp)
state = uart_get(drv, line);
- mtpt = (struct mp_port *)state->port;
-
if (IS_ERR(state)) {
retval = PTR_ERR(state);
goto fail;
}
+ mtpt = (struct mp_port *)state->port;
+
tty->driver_data = state;
tty->low_latency = (state->port->flags & UPF_LOW_LATENCY) ? 1 : 0;
tty->alt_speed = 0;