Skip to contentSkip to conversation

drivers/usb/serial/mos7840.c: fix a check-after-dereference

PATCH New Adrian Bunk 1 participant 1 message Oct 8, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/usb/serial/mos7840.c: fix a check-after-dereference

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

drivers/usb/serial/mos7840.c renamed from drivers/usb/serial/mos7840.c.old +2 -1
@@ -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) {