Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1305454

[PATCH v2 04/10] tty: Remove !tty check from free_tty_struct()

From Peter Hurley <peter@hurleysoftware.com>
Newsgroups linux.kernel
Subject [PATCH v2 04/10] tty: Remove !tty check from free_tty_struct()
Date 2016-01-10 06:20 +0100
Message-ID <qPgA2-87H-11@gated-at.bofh.it> (permalink)
References <qzDqV-2GJ-3@gated-at.bofh.it> <qPgA1-87H-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


free_tty_struct() is never called with NULL tty; the two call sites
would already have faulted on earlier access.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/tty_io.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index e487076..17a3ffb 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -171,8 +171,6 @@ static void release_tty(struct tty_struct *tty, int idx);
 
 void free_tty_struct(struct tty_struct *tty)
 {
-	if (!tty)
-		return;
 	tty_ldisc_deinit(tty);
 	put_device(tty->dev);
 	kfree(tty->write_buf);
-- 
2.7.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/10] Rework tty_reopen() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 01/10] tty: Wait interruptibly for tty lock on reopen Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 06/10] tty: Re-declare tty_driver_remove_tty() file scope Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 03/10] tty: Fix ldisc leak in failed tty_init_dev() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 05/10] tty: Fix tty_init_termios() declaration Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 04/10] tty: Remove !tty check from free_tty_struct() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 07/10] pty: Remove pty_unix98_shutdown() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 08/10] tty: Remove __lockfunc annotation from tty lock functions Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 02/10] tty: Retry failed reopen if tty teardown in-progress Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 09/10] tty: Consolidate noctty checks in tty_open() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
  [PATCH v2 10/10] tty: Refactor tty_open() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100

csiph-web