Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8441bf5e authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

staging: sb105x: move dereference under IS_ERR() check



Avoid dereverencing the ERR_PTR() by shifting the dereference down a
couple lines.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2fbedf67
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;