From: Len Brown <lenb@kernel.org>
To: Zhao Yakui <yakui.zhao@intel.com>
Cc: linux-acpi@vger.kernel.org
Subject: Re: [PATCH 2/5] ACPI: Check parameter when calling acpi_processor_get/set_throttling
Date: Sat, 2 Feb 2008 02:29:50 -0500 [thread overview]
Message-ID: <200802020229.50224.lenb@kernel.org> (raw)
In-Reply-To: <1201499610.17068.21.camel@yakui_zhao.sh.intel.com>
is the patch below still necessary after this (upstream) fix:
http://bugzilla.kernel.org/show_bug.cgi?id=9747#c2
thanks,
-Len
On Monday 28 January 2008 00:53, Zhao Yakui wrote:
> Subject: ACPI : Check parameter when calling acpi_processor_get/set_throttling
> >From : Zhao Yakui <yakui.zhao@intel.com>
>
> It is necessary to check the parameter when calling the function of
> acpi_processor_get/set_throttling function so as to avoid the NULL
> pointer reference in pr or throttling.
>
> http://bugzilla.kernel.org/show_bug.cgi?id=9747
>
> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
> ---
> drivers/acpi/processor_throttling.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> Index: linux-2.6/drivers/acpi/processor_throttling.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/processor_throttling.c
> +++ linux-2.6/drivers/acpi/processor_throttling.c
> @@ -589,6 +589,11 @@ static int acpi_processor_get_throttling
> 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
> {
> 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.
> */
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
prev parent reply other threads:[~2008-02-02 7:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-28 5:53 [PATCH 2/5] ACPI: Check parameter when calling acpi_processor_get/set_throttling Zhao Yakui
2008-02-02 7:29 ` Len Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200802020229.50224.lenb@kernel.org \
--to=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=yakui.zhao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.