• Johan Hovold's avatar
    can: kvaser_usb: fix interface sanity check · 5660493c
    Johan Hovold authored
    Make sure to use the current alternate setting when verifying the
    interface descriptors to avoid binding to an invalid interface.
    
    Failing to do so could cause the driver to misbehave or trigger a WARN()
    in usb_submit_urb() that kernels with panic_on_warn set would choke on.
    
    Fixes: aec5fb22 ("can: kvaser_usb: Add support for Kvaser USB hydra family")
    Cc: stable <stable@vger.kernel.org>     # 4.19
    Cc: Jimmy Assarsson <extja@kvaser.com>
    Cc: Christer Beskow <chbe@kvaser.com>
    Cc: Nicklas Johansson <extnj@kvaser.com>
    Cc: Martin Henriksson <mh@kvaser.com>
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    5660493c
kvaser_usb_hydra.c 50.9 KB