Skip to content

Commit 10d4879

Browse files
committed
Merge tag 'thermal-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fixes from Rafael Wysocki: "Fix two issues introduced recently and one driver problem leading to a NULL pointer dereference in some cases. Specifics: - Add missing EXPORT_SYMBOL_GPL in the thermal core and add back the required 'trips' property to the thermal zone DT bindings (Daniel Lezcano) - Prevent the int340x_thermal driver from crashing when a package with a buffer of 0 length is returned by an ACPI control method evaluated by it (Lee, Chun-Yi)" * tag 'thermal-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal/int340x_thermal: handle data_vault when the value is ZERO_SIZE_PTR dt-bindings: thermal: Fix missing required property thermal/core: Add missing EXPORT_SYMBOL_GPL
2 parents b98f602 + 3bf1b15 commit 10d4879

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Documentation/devicetree/bindings/thermal/thermal-zones.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ patternProperties:
214214
- polling-delay
215215
- polling-delay-passive
216216
- thermal-sensors
217+
- trips
217218

218219
additionalProperties: false
219220

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ static void int3400_setup_gddv(struct int3400_thermal_priv *priv)
527527
priv->data_vault = kmemdup(obj->package.elements[0].buffer.pointer,
528528
obj->package.elements[0].buffer.length,
529529
GFP_KERNEL);
530-
if (!priv->data_vault)
530+
if (ZERO_OR_NULL_PTR(priv->data_vault))
531531
goto out_free;
532532

533533
bin_attr_data_vault.private = priv->data_vault;
@@ -597,7 +597,7 @@ static int int3400_thermal_probe(struct platform_device *pdev)
597597
goto free_imok;
598598
}
599599

600-
if (priv->data_vault) {
600+
if (!ZERO_OR_NULL_PTR(priv->data_vault)) {
601601
result = sysfs_create_group(&pdev->dev.kobj,
602602
&data_attribute_group);
603603
if (result)
@@ -615,7 +615,8 @@ static int int3400_thermal_probe(struct platform_device *pdev)
615615
free_sysfs:
616616
cleanup_odvp(priv);
617617
if (priv->data_vault) {
618-
sysfs_remove_group(&pdev->dev.kobj, &data_attribute_group);
618+
if (!ZERO_OR_NULL_PTR(priv->data_vault))
619+
sysfs_remove_group(&pdev->dev.kobj, &data_attribute_group);
619620
kfree(priv->data_vault);
620621
}
621622
free_uuid:
@@ -647,7 +648,7 @@ static int int3400_thermal_remove(struct platform_device *pdev)
647648
if (!priv->rel_misc_dev_res)
648649
acpi_thermal_rel_misc_device_remove(priv->adev->handle);
649650

650-
if (priv->data_vault)
651+
if (!ZERO_OR_NULL_PTR(priv->data_vault))
651652
sysfs_remove_group(&pdev->dev.kobj, &data_attribute_group);
652653
sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
653654
sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);

drivers/thermal/thermal_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,7 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
13291329
kfree(tz);
13301330
return ERR_PTR(result);
13311331
}
1332+
EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips);
13321333

13331334
struct thermal_zone_device *thermal_zone_device_register(const char *type, int ntrips, int mask,
13341335
void *devdata, struct thermal_zone_device_ops *ops,

0 commit comments

Comments
 (0)