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>] [day] [month] [year] [list]
Date:	Tue, 14 Aug 2007 23:22:50 +0200
From:	Adrian Bunk <bunk@...nel.org>
To:	gregkh@...e.de
Cc:	linux-usb-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: [2.6 patch] drivers/usb/serial/ark3116.c: fix check-after-use

The Coverity checker spotted that we'd have already oops'ed if one of 
these was NULL.

Signed-off-by: Adrian Bunk <bunk@...nel.org>

---
--- linux-2.6.23-rc1-mm2/drivers/usb/serial/ark3116.c.old	2007-08-08 15:00:03.000000000 +0200
+++ linux-2.6.23-rc1-mm2/drivers/usb/serial/ark3116.c	2007-08-08 15:00:24.000000000 +0200
@@ -159,37 +159,32 @@
 static void ark3116_set_termios(struct usb_serial_port *port,
 				struct ktermios *old_termios)
 {
 	struct usb_serial *serial = port->serial;
 	struct ark3116_private *priv = usb_get_serial_port_data(port);
 	unsigned int cflag = port->tty->termios->c_cflag;
 	unsigned long flags;
 	int baud;
 	int ark3116_baud;
 	char *buf;
 	char config;
 
 	config = 0;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	if (!port->tty || !port->tty->termios) {
-		dbg("%s - no tty structures", __FUNCTION__);
-		return;
-	}
-
 	spin_lock_irqsave(&priv->lock, flags);
 	if (!priv->termios_initialized) {
 		*(port->tty->termios) = tty_std_termios;
 		port->tty->termios->c_cflag = B9600 | CS8
 					      | CREAD | HUPCL | CLOCAL;
 		priv->termios_initialized = 1;
 	}
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	cflag = port->tty->termios->c_cflag;
 
 	buf = kmalloc(1, GFP_KERNEL);
 	if (!buf) {
 		dbg("error kmalloc");
 		return;
 	}
-
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