• Daniel Mack's avatar
    USB: fix LANGID=0 regression · 0cce2eda
    Daniel Mack authored
    commit b7af0bb2 ("USB: allow malformed LANGID descriptors") broke support
    for devices without string descriptor support.
    
    Reporting string descriptors is optional to USB devices, and a device
    lets us know it can't deal with strings by responding to the LANGID
    request with a STALL token.
    
    The kernel handled that correctly before b7af0bb2 came in, but failed
    hard if the LANGID was reported but broken. More than that, if a device
    was not able to provide string descriptors, the LANGID was retrieved
    over and over again at each string read request.
    
    This patch changes the behaviour so that
    
     a) the LANGID is only queried once
     b) devices which can't handle string requests are not asked again
     c) devices with malformed LANGID values have a sane fallback to 0x0409
    Signed-off-by: default avatarDaniel Mack <daniel@caiaq.de>
    Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Cc: stable <stable@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    0cce2eda
message.c 58.1 KB