• James Bottomley's avatar
    [SCSI] fix memory leak in initialization · 37e6ba00
    James Bottomley authored
    The root cause of the problem is the fact that dev_set_name() now
    allocates storage instead of using the original array within the kobj.
    That means that the SCSI assumption that if you haven't made the
    containing object or any sub objects visible, you can just destroy it
    (and its component devices) lock stock and barrel becomes false.
    
    Fix this by doing the get of sdev_dev at parent time and thus do an
    extra put of it in scsi_destroy_sdev() (and all other destruction
    without add paths).
    Reported-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
    37e6ba00
scsi_sysfs.c 26.7 KB