Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9654a818 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "thermal: tsens: Check pointer validity before accessing its variables"

parents 769f4c70 c422b562
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -5841,6 +5841,11 @@ static int tsens_thermal_zone_register(struct tsens_tm_device *tmdev)
	const struct of_device_id *id;
	struct device_node *of_node;

	if (tmdev == NULL) {
		pr_err("Invalid tsens instance\n");
		return -EINVAL;
	}

	of_node = tmdev->pdev->dev.of_node;
	if (of_node == NULL) {
		pr_err("Invalid of_node??\n");
@@ -5858,11 +5863,6 @@ static int tsens_thermal_zone_register(struct tsens_tm_device *tmdev)
		return -ENODEV;
	}

	if (tmdev == NULL) {
		pr_err("Invalid tsens instance\n");
		return -EINVAL;
	}

	for (i = 0; i < tmdev->tsens_num_sensor; i++) {
		char name[18];
		if ((!strcmp(id->compatible, "qcom,mdm9640-tsens")) ||