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

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
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment