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: bed35c6dfa ("serdev: add a tty port controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dan Carpenter 2017-02-08 10:23:24 +03:00 committed by Greg Kroah-Hartman
parent 80cd94e759
commit 10d258c518
1 changed files with 2 additions and 0 deletions

View File

@ -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;