• Alan Stern's avatar
    USB: handle NULL config in usb_find_alt_setting() · c9a4cb20
    Alan Stern authored
    usb_find_alt_setting() takes a pointer to a struct usb_host_config as
    an argument; it searches for an interface with specified interface and
    alternate setting numbers in that config.  However, it crashes if the
    usb_host_config pointer argument is NULL.
    
    Since this is a general-purpose routine, available for use in many
    places, we want to to be more robust.  This patch makes it return NULL
    whenever the config argument is NULL.
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Reported-by: syzbot+19c3aaef85a89d451eac@syzkaller.appspotmail.com
    CC: <stable@vger.kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    c9a4cb20
usb.c 35.3 KB