• Guenter Roeck's avatar
    thermal/core: Delete device under thermal device zone lock · 30b2ae07
    Guenter Roeck authored
    Thermal device attributes may still be opened after unregistering
    the thermal zone and deleting the thermal device.
    
    Currently there is no protection against accessing thermal device
    operations after unregistering a thermal zone. To enable adding
    such protection, protect the device delete operation with the
    thermal zone device mutex. This requires splitting the call to
    device_unregister() into its components, device_del() and put_device().
    Only the first call can be executed under mutex protection, since
    put_device() may result in releasing the thermal zone device memory.
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    30b2ae07
thermal_core.c 38.7 KB