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

Commit 10d258c5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

serdev: ttyport: check whether tty_init_dev() fails



My static checker complains that we don't have any error handling here.
It's simple enough to add it.

Fixes: bed35c6d ("serdev: add a tty port controller driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 80cd94e7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@ static int ttyport_open(struct serdev_controller *ctrl)
	struct ktermios ktermios;

	tty = tty_init_dev(serport->tty_drv, serport->tty_idx);
	if (IS_ERR(tty))
		return PTR_ERR(tty);
	serport->tty = tty;

	serport->port->client_ops = &client_ops;