• James Bottomley's avatar
    [PATCH] Fix removable USB drive oops · 4352438e
    James Bottomley authored
    The actual problem reported was because there wasn't a corresponding
    check on transport_classdev.class in the unregister.
    
    However, on closer inspection I also turned up a nasty thinko in the
    reference counting.  For reasons best known to the class code authors,
    class devices have to obtain their own references to the devices they're
    attached to which they release again in their .release routines, so you
    have to remember to do a get_device() in the correct place after the
    class_device_add().  I put comments in the code so that, hopefully, we
    can avoid the problem in future.
    4352438e
scsi_sysfs.c 12.7 KB