lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 12 May 2008 19:27:10 +0100
From:	Chris Malley <mail@...ismalley.co.uk>
To:	Alan Cox <alan@...hat.com>
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] riscom8: remove redundant null pointer test

tty has already been dereferenced at least twice in these functions,
so checking for null here seems a bit unnecessary.

Signed-off-by: Chris Malley <mail@...ismalley.co.uk>
---
 drivers/char/riscom8.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index f073c71..9643a49 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -1108,7 +1108,7 @@ static int rc_write(struct tty_struct *tty,
 
 	bp = port_Board(port);
 
-	if (!tty || !port->xmit_buf)
+	if (!port->xmit_buf)
 		return 0;
 
 	while (1) {
@@ -1151,7 +1151,7 @@ static int rc_put_char(struct tty_struct *tty, unsigned char ch)
 	if (rc_paranoia_check(port, tty->name, "rc_put_char"))
 		return 0;
 
-	if (!tty || !port->xmit_buf)
+	if (!port->xmit_buf)
 		return 0;
 
 	spin_lock_irqsave(&riscom_lock, flags);
-- 



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ