View | Details | Raw Unified | Return to bug 2588 | Differences between
and this patch

Collapse All | Expand All

(-)/tmp/acpi/thermal.c (-5 / +14 lines)
Lines 892-899 Link Here
892
	struct seq_file		*m = (struct seq_file *)file->private_data;
892
	struct seq_file		*m = (struct seq_file *)file->private_data;
893
	struct acpi_thermal	*tz = (struct acpi_thermal *)m->private;
893
	struct acpi_thermal	*tz = (struct acpi_thermal *)m->private;
894
894
895
	char			limit_string[25] = {'\0'};
895
	char			limit_string[65] = {'\0'};
896
	int			critical, hot, passive, active0, active1;
896
	int			num, critical, hot, passive;
897
	int			active[9];
898
	int			i = 0;
897
899
898
	ACPI_FUNCTION_TRACE("acpi_thermal_write_trip_points");
900
	ACPI_FUNCTION_TRACE("acpi_thermal_write_trip_points");
899
901
Lines 909-915 Link Here
909
	
911
	
910
	limit_string[count] = '\0';
912
	limit_string[count] = '\0';
911
913
912
	if (sscanf(limit_string, "%d:%d:%d:%d:%d", &critical, &hot, &passive, &active0, &active1) != 5) {
914
	num = sscanf(limit_string, "%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d",
915
				&critical, &hot, &passive,
916
				&active[0], &active[1], &active[2], &active[3], &active[4],
917
				&active[5], &active[6], &active[7], &active[8], &active[9]);
918
	if(!(num >=5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) {
913
		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n"));
919
		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n"));
914
		return_VALUE(-EINVAL);
920
		return_VALUE(-EINVAL);
915
	}
921
	}
Lines 917-924 Link Here
917
	tz->trips.critical.temperature = CELSIUS_TO_KELVIN(critical);
923
	tz->trips.critical.temperature = CELSIUS_TO_KELVIN(critical);
918
	tz->trips.hot.temperature = CELSIUS_TO_KELVIN(hot);
924
	tz->trips.hot.temperature = CELSIUS_TO_KELVIN(hot);
919
	tz->trips.passive.temperature = CELSIUS_TO_KELVIN(passive);
925
	tz->trips.passive.temperature = CELSIUS_TO_KELVIN(passive);
920
	tz->trips.active[0].temperature = CELSIUS_TO_KELVIN(active0);
926
	for (i = 0; i < num - 3; i++) {
921
	tz->trips.active[1].temperature = CELSIUS_TO_KELVIN(active1);
927
		if (!(tz->trips.active[i].flags.valid))
928
			break;
929
		tz->trips.active[i].temperature = CELSIUS_TO_KELVIN(active[i]);
930
	}
922
	
931
	
923
	return_VALUE(count);
932
	return_VALUE(count);
924
}
933
}

Return to bug 2588