Message ID | 5802156.DvuYhMxLoT@rjwysocki.net |
---|---|
State | New |
Headers | show |
Series | [v3] thermal: core: Add sanity checks for polling_delay and passive_delay | expand |
Index: linux-pm/drivers/thermal/thermal_core.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_core.c +++ linux-pm/drivers/thermal/thermal_core.c @@ -1391,6 +1391,14 @@ thermal_zone_device_register_with_trips( if (num_trips > 0 && !trips) return ERR_PTR(-EINVAL); + if (polling_delay) { + if (passive_delay > polling_delay) + return ERR_PTR(-EINVAL); + + if (!passive_delay) + passive_delay = polling_delay; + } + if (!thermal_class) return ERR_PTR(-ENODEV);