From: Adrian Bunk This patch fixes an obvious check-after-dereference spotted by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton --- drivers/usb/serial/mos7840.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -puN drivers/usb/serial/mos7840.c~drivers-usb-serial-mos7840c-fix-a-check-after-dereference drivers/usb/serial/mos7840.c --- a/drivers/usb/serial/mos7840.c~drivers-usb-serial-mos7840c-fix-a-check-after-dereference +++ a/drivers/usb/serial/mos7840.c @@ -2412,11 +2412,12 @@ static int mos7840_ioctl(struct usb_seri } 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) { _