• Alan Stern's avatar
    [PATCH] USB: Remove interface/altsettings assumption from audio driver · 2d5185c7
    Alan Stern authored
    This patch updates the USB audio class driver to use the usb_ifnum_to_if()
    and usb_altnum_to_altsetting() routines, thereby removing assumptions
    about which interface or altsetting is stored in which array entry.
    
    It also simplifies the driver's probe() routine by using the raw
    configuration descriptor already loaded into memory instead of reading the
    descriptor from the device.  Now, either the current driver has a bug and
    never deallocates the buffer used to hold the descriptor, or else I've
    introduced a double-free error.  There's no obvious place where the buffer
    gets freed, but it's hard to be certain.
    
    It would be good if someone could try out this patch.  I can't test it,
    not having any USB audio devices handy.  If the double-free error is
    present, it will show up when the device is disconnected and the
    configuration data is released.
    2d5185c7
audio.c 121 KB