summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty')
-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;