mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6 patch] drivers/usb/serial/mos7840.c: fix a check-after-dereference
@ 2006-10-08 23:16 Adrian Bunk
  0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2006-10-08 23:16 UTC (permalink / raw)
  To: Paul B Schroeder; +Cc: linux-kernel, gregkh, linux-usb-devel

This patch fixes an obvious check-after-dereference spotted by the 
Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6/drivers/usb/serial/mos7840.c.old	2006-10-09 00:35:49.000000000 +0200
+++ linux-2.6/drivers/usb/serial/mos7840.c	2006-10-09 00:36:28.000000000 +0200
@@ -2412,11 +2412,12 @@
 	}
 
 	mos7840_port = mos7840_get_port_private(port);
-	tty = mos7840_port->port->tty;
 
 	if (mos7840_port == NULL)
 		return -1;
 
+	tty = mos7840_port->port->tty;
+
 	dbg("%s - port %d, cmd = 0x%x", __FUNCTION__, port->number, cmd);
 
 	switch (cmd) {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-08 23:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-08 23:16 [2.6 patch] drivers/usb/serial/mos7840.c: fix a check-after-dereference Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®