• Tejun Heo's avatar
    [PATCH] driver-core: don't free devt_attr till the device is released · 82f6951e
    Tejun Heo authored
    Currently, devt_attr for the "dev" file is freed immediately on device
    removal, but if the "dev" sysfs file is open when a device is removed,
    sysfs will access its attribute structure for further access including
    close resulting in jumping to garbled address.  Fix it by postponing
    freeing devt_attr to device release time.
    
    Note that devt_attr for class_device is already freed on release.
    
    This bug is reported by Chris Rankin as bugzilla bug#8198.
    Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
    Cc: Chris Rankin <rankincj@yahoo.com>
    Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
    82f6951e
core.c 30 KB