• Alan Stern's avatar
    [PATCH] usbcore: Make the core release hcd structures · 1e727616
    Alan Stern authored
    This patch contains changes to usbcore making the core responsible for
    deallocating memory for usb_hcd structures, rather than calling back into
    the host controller drivers.  This solves a long-standing oops, since the
    drivers may have been unloaded from memory by the time the release routine
    is called.  (There probably are some Bugzilla entries caused by this, but
    I don't know which ones.)
    
    To really fix this up properly will require merging the HCD "glue" layer
    into the higher core structures.  As things stand now, a usb_hcd contains
    a usb_bus member, and the usb_bus is associated with a class_device: when
    the class_device is released the usb_hcd gets deallocated.  It's awkward
    in that neither the usb_hcd nor the usb_bus has its own reference count,
    and the class_device is created when the bus is registered (not when it is
    initialized).
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    1e727616
hcd-pci.c 10.9 KB