• Johan Hovold's avatar
    USB: serial: qcserial: fix altsetting probing · be4c5eb2
    Johan Hovold authored
    Drivers should not assume that interface descriptors have been parsed in
    any particular order so use the interface number to look up the second
    alternate setting. That number is also what the driver later use to
    switch setting.
    
    Note that although the driver could end up verifying the existence of
    the expected endpoints on the wrong interface, a later sanity check in
    usb_wwan_port_probe() would have caught this before it could cause any
    real damage.
    
    Fixes: a78b4282 ("USB: serial: add qualcomm wireless modem driver")
    Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    be4c5eb2
qcserial.c 17.1 KB