mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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>
This commit is contained in:
parent
2fbedf67ed
commit
8441bf5e06
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue