lkml.org 
[lkml]   [2019]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] tty: not call tty close in fallback
Date
yes@hpe.com:

550 5.1.1 User Unknown

You are sending e-mails/patches from a non-existant address?

On 14. 01. 19, 7:56, yes@hpe.com wrote:
> From: Li RongQing <lirongqing@baidu.com>
>
> when fail to open tty, tty is not in open status and not need
> to call close

But tty drivers are special and expect close even on failed open, right?
See tty_open.

> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
> drivers/tty/serdev/serdev-ttyport.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index fa1672993b4c..bcc1e27d00de 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
> @@ -121,7 +121,7 @@ static int ttyport_open(struct serdev_controller *ctrl)
>
> ret = tty->ops->open(serport->tty, NULL);
> if (ret)
> - goto err_close;
> + goto err_unlock;
>
> tty_unlock(serport->tty);
>
> @@ -142,8 +142,6 @@ static int ttyport_open(struct serdev_controller *ctrl)
>
> return 0;
>
> -err_close:
> - tty->ops->close(tty, NULL);
> err_unlock:
> tty_unlock(tty);
> tty_release_struct(tty, serport->tty_idx);
>

thanks,
--
js
suse labs

\
 
 \ /
  Last update: 2019-01-14 08:51    [W:0.033 / U:3.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site