Browse Source

USB: serial: keyspan: Fix possible null pointer dereference.

Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Huzaifa Sidhpurwala 14 years ago
parent
commit
d866150a19
1 changed files with 5 additions and 5 deletions
  1. 5 5
      drivers/usb/serial/keyspan.c

+ 5 - 5
drivers/usb/serial/keyspan.c

@@ -2121,16 +2121,16 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial,
 	/* Work out which port within the device is being setup */
 	/* Work out which port within the device is being setup */
 	device_port = port->number - port->serial->minor;
 	device_port = port->number - port->serial->minor;
 
 
-	dbg("%s - endpoint %d port %d (%d)",
-			__func__, usb_pipeendpoint(this_urb->pipe),
-			port->number, device_port);
-
-		/* Make sure we have an urb then send the message */
+	/* Make sure we have an urb then send the message */
 	if (this_urb == NULL) {
 	if (this_urb == NULL) {
 		dbg("%s - oops no urb for port %d.", __func__, port->number);
 		dbg("%s - oops no urb for port %d.", __func__, port->number);
 		return -1;
 		return -1;
 	}
 	}
 
 
+	dbg("%s - endpoint %d port %d (%d)",
+			__func__, usb_pipeendpoint(this_urb->pipe),
+			port->number, device_port);
+
 	/* Save reset port val for resend.
 	/* Save reset port val for resend.
 	   Don't overwrite resend for open/close condition. */
 	   Don't overwrite resend for open/close condition. */
 	if ((reset_port + 1) > p_priv->resend_cont)
 	if ((reset_port + 1) > p_priv->resend_cont)