kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] serdev: ttyport: check whether tty_init_dev() fails
@ 2017-02-08  7:23 Dan Carpenter
  2017-02-08 13:40 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-02-08  7:23 UTC (permalink / raw)
  To: Rob Herring; +Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, kernel-janitors

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>

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] serdev: ttyport: check whether tty_init_dev() fails
  2017-02-08  7:23 [patch] serdev: ttyport: check whether tty_init_dev() fails Dan Carpenter
@ 2017-02-08 13:40 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2017-02-08 13:40 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial@vger.kernel.org,
	kernel-janitors

On Wed, Feb 8, 2017 at 1:23 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-08 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-08  7:23 [patch] serdev: ttyport: check whether tty_init_dev() fails Dan Carpenter
2017-02-08 13:40 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).