summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serdev
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-02-08 08:23:24 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-09 13:54:49 +0100
commit10d258c51869916347adce4312e6fe41fa5144ad (patch)
treed1bf7131a33aeb5da10722eaa0ee8313d46dfde0 /drivers/tty/serdev
parentserial: 8250_pci: make pciserial_detach_ports() static (diff)
downloadlinux-10d258c51869916347adce4312e6fe41fa5144ad.tar.xz
linux-10d258c51869916347adce4312e6fe41fa5144ad.zip
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: bed35c6dfa6a ("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>
Diffstat (limited to 'drivers/tty/serdev')
-rw-r--r--drivers/tty/serdev/serdev-ttyport.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
index 683320b81a2b..d05393594f15 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -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;