• J
    USB: serial: use port endpoint size to determine if ep is available · eb8878a8
    Johan Hovold 提交于
    It is possible to have a multi-port device with a port lacking an in or
    out bulk endpoint. Only checking for num_bulk_in or num_bulk_out is thus not
    sufficient to determine whether a specific port has an in or out bulk
    endpoint.
    
    This fixes potential null pointer dereferences in the generic open and
    write routines, as well as access to uninitialised fifo in write_room
    and chars_in_buffer.
    
    Also let write fail with ENODEV (instead of 0) on missing out endpoint
    (also on zero-length writes).
    Signed-off-by: NJohan Hovold <jhovold@gmail.com>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
    eb8878a8
generic.c 16.0 KB