USB: serial: ti_usb_3410_5052: drop bogus read urb check
authorJohan Hovold <johan@kernel.org>
Thu, 24 Apr 2025 07:44:48 +0000 (09:44 +0200)
committerJohan Hovold <johan@kernel.org>
Mon, 5 May 2025 12:25:59 +0000 (14:25 +0200)
The read urb pointer is dereferenced before checking that it is non-NULL
during open(), but no check is needed as the existence of a bulk in
endpoint is verified during attach() since commit ef079936d3cd ("USB:
serial: ti_usb_3410_5052: fix NULL-deref at open").

Drop the bogus read urb sanity check.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ti_usb_3410_5052.c

index a0c244bc77c094a52f838a14da1bb1ea1a47babe..d671189ecee279991ebd8b2c40a957d3226f2ee0 100644 (file)
@@ -729,11 +729,6 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port)
 
        /* start read urb */
        urb = port->read_urb;
-       if (!urb) {
-               dev_err(&port->dev, "%s - no read urb\n", __func__);
-               status = -EINVAL;
-               goto unlink_int_urb;
-       }
        tport->tp_read_urb_state = TI_READ_URB_RUNNING;
        urb->context = tport;
        status = usb_submit_urb(urb, GFP_KERNEL);