• Alan Stern's avatar
    [PATCH] USB: Changes to core/config.c (2 of 9) · 8fc9363d
    Alan Stern authored
    This patch fixes the most blatant problems that can happen when an error
    is encountered during descriptor parsing.
    
    	The struct device embedded within a struct usb_interface is
    initialized as soon as the structure is allocated, so that when
    put_device() is called it will contain valid data.
    
    	put_device() is not called for unallocated interfaces.
    
    	The pointers in config->extra are freed when the struct
    usb_host_config is freed.
    
    	rawdescriptor pointers are initialized to 0 so that they can be
    freed without error.
    
    	Partially parsed configurations are remembered so that they will
    be deallocated when the entire struct usb_device is freed.
    8fc9363d
config.c 13.1 KB