Skip to content

Commit

Permalink
staging: sb105x: move dereference under IS_ERR() check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Jan 18, 2013
1 parent 2fbedf6 commit 8441bf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/sb105x/sb_pci_mp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8441bf5

Please sign in to comment.