Skip to contentSkip to conversation

: Propagate error code from devpts_pty_new

PATCH In review [email protected] 3 participants 3 messages Apr 16, 2008 – Apr 17, 2008 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Propagate error code from devpts_pty_new

From: Sukadev Bhattiprolu <[email protected]>
Subject: [PATCH]: Propagate error code from devpts_pty_new

Have ptmx_open() propagate any error code returned by devpts_pty_new() (which returns either 0 or -ENOMEM anyway).

---
 drivers/char/tty_io.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/tty_io.c +2 -2
Index: 2.6.25-rc8-mm2/drivers/char/tty_io.c
===================================================================
@@ -2835,8 +2835,8 @@ static int ptmx_open(struct inode *inode
 	filp->private_data = tty;
 	file_move(filp, &tty->tty_files);
 
-	retval = -ENOMEM;
-	if (devpts_pty_new(tty->link))
+	retval = devpts_pty_new(tty->link);
+	if (retval)
 		goto out1;
 
 	check_tty_count(tty, "tty_open");
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Quoting sukadev-r/[email protected]…

From: Sukadev Bhattiprolu <sukadev-r/[email protected]>
Subject: [PATCH]: Propagate error code from devpts_pty_new

Have ptmx_open() propagate any error code returned by devpts_pty_new() (which returns either 0 or -ENOMEM anyway).

Seems nice and non-contentuous.

thanks,
-serge

Quoted 19 lines
---
 drivers/char/tty_io.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: 2.6.25-rc8-mm2/drivers/char/tty_io.c
===================================================================

drivers/char/tty_io.c +2 -2
@@ -2835,8 +2835,8 @@ static int ptmx_open(struct inode *inode
 	filp->private_data = tty;
 	file_move(filp, &tty->tty_files);
 
-	retval = -ENOMEM;
-	if (devpts_pty_new(tty->link))
+	retval = devpts_pty_new(tty->link);
+	if (retval)
 		goto out1;
 
 	check_tty_count(tty, "tty_open");
#2 lore raw
Quoted 4 lines · Serge E. Hallyn
Quoted 3 lines · Quoting sukadev-r/[email protected]…

From: Sukadev Bhattiprolu <sukadev-r/[email protected]>
Subject: [PATCH]: Propagate error code from devpts_pty_new

Quoted 8 lines
Quoted 4 lines

Have ptmx_open() propagate any error code returned by devpts_pty_new() (which returns either 0 or -ENOMEM anyway).

Seems nice and non-contentuous.