Skip to content

Commit

Permalink
USB: mos7840.c: fix a check-after-dereference
Browse files Browse the repository at this point in the history
This patch fixes an obvious check-after-dereference spotted by the
Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Adrian Bunk authored and Greg Kroah-Hartman committed Oct 17, 2006
1 parent c19ecd6 commit ad18027
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/serial/mos7840.c
Original file line number Diff line number Diff line change
Expand Up @@ -2413,11 +2413,12 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file,
}

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) {
Expand Down

0 comments on commit ad18027

Please sign in to comment.