From bc3b1b39ad17aa7f22dfece69e28bdf0bb53a497 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Mon, 28 Jan 2008 13:53:30 +0800 Subject: [PATCH] --- yaml --- r: 84163 b: refs/heads/master c: 87654273ef63213f90c4243913987436495824f0 h: refs/heads/master i: 84161: e746c159aa4b984ff083c69604ee8a7eb7cdfbc2 84159: 7870bffe18ef2e4ace29cac61906e3f1f1ce34a1 v: v3 --- [refs] | 2 +- trunk/drivers/acpi/processor_throttling.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 3db0e3eae4f1..6aeb1c42420c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3abbd337c60591305cbfeb984ff2922c175be37f +refs/heads/master: 87654273ef63213f90c4243913987436495824f0 diff --git a/trunk/drivers/acpi/processor_throttling.c b/trunk/drivers/acpi/processor_throttling.c index 1685b40abda7..5d2eae207886 100644 --- a/trunk/drivers/acpi/processor_throttling.c +++ b/trunk/drivers/acpi/processor_throttling.c @@ -589,6 +589,11 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr) cpumask_t saved_mask; int ret; + if (!pr) + return -EINVAL; + + if (!pr->flags.throttling) + return -ENODEV; /* * Migrate task to the cpu pointed by pr. */ @@ -743,6 +748,16 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) { cpumask_t saved_mask; int ret; + + if (!pr) + return -EINVAL; + + if (!pr->flags.throttling) + return -ENODEV; + + if ((state < 0) || (state > (pr->throttling.state_count - 1))) + return -EINVAL; + /* * Migrate task to the cpu pointed by pr. */