public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpi/processor: fix for !CONFIG_CPU_IDLE
@ 2010-06-24 14:40 Jan Beulich
  2010-06-28 18:42 ` Len Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2010-06-24 14:40 UTC (permalink / raw)
  To: len.brown; +Cc: linux-acpi

The conditional modified (to have an 'else' portion) in commit
2671717265ae6e720a9ba5f13fbec3a718983b65 degenerates to an
unconditional NULL dereference when CONFIG_CPU_IDLE is off, as
cpuidle_register_driver() returns non-zero in this case, and
cpu_idle_get_driver() returns NULL. The simplest solution is to make
the whole construct depend on CONFIG_CPU_IDLE bein defined.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 drivers/acpi/processor_driver.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-2.6.35-rc3/drivers/acpi/processor_driver.c
+++ 2.6.35-rc3-acpi-no-cpuidle/drivers/acpi/processor_driver.c
@@ -922,6 +922,7 @@ static int __init acpi_processor_init(vo
 		return -ENOMEM;
 #endif
 
+#ifdef CONFIG_CPU_IDLE
 	if (!cpuidle_register_driver(&acpi_idle_driver)) {
 		printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
 			acpi_idle_driver.name);
@@ -929,6 +930,7 @@ static int __init acpi_processor_init(vo
 		printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s",
 			cpuidle_get_driver()->name);
 	}
+#endif
 
 	result = acpi_bus_register_driver(&acpi_processor_driver);
 	if (result < 0)




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] acpi/processor: fix for !CONFIG_CPU_IDLE
  2010-06-24 14:40 [PATCH] acpi/processor: fix for !CONFIG_CPU_IDLE Jan Beulich
@ 2010-06-28 18:42 ` Len Brown
  2010-06-29  6:45   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Len Brown @ 2010-06-28 18:42 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-acpi

On Thu, 24 Jun 2010, Jan Beulich wrote:

> The conditional modified (to have an 'else' portion) in commit
> 2671717265ae6e720a9ba5f13fbec3a718983b65 degenerates to an
> unconditional NULL dereference when CONFIG_CPU_IDLE is off, as
> cpuidle_register_driver() returns non-zero in this case, and
> cpu_idle_get_driver() returns NULL. The simplest solution is to make
> the whole construct depend on CONFIG_CPU_IDLE bein defined.
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>

As CONFIG_ACPI selects CONFIG_CPU_IDLE,
how were you able to provoke this issue?

thanks,
-Len Brown, Intel Open Source Technology Center

> ---
>  drivers/acpi/processor_driver.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- linux-2.6.35-rc3/drivers/acpi/processor_driver.c
> +++ 2.6.35-rc3-acpi-no-cpuidle/drivers/acpi/processor_driver.c
> @@ -922,6 +922,7 @@ static int __init acpi_processor_init(vo
>  		return -ENOMEM;
>  #endif
>  
> +#ifdef CONFIG_CPU_IDLE
>  	if (!cpuidle_register_driver(&acpi_idle_driver)) {
>  		printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
>  			acpi_idle_driver.name);
> @@ -929,6 +930,7 @@ static int __init acpi_processor_init(vo
>  		printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s",
>  			cpuidle_get_driver()->name);
>  	}
> +#endif
>  
>  	result = acpi_bus_register_driver(&acpi_processor_driver);
>  	if (result < 0)
> 
> 
> 
> --
> 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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] acpi/processor: fix for !CONFIG_CPU_IDLE
  2010-06-28 18:42 ` Len Brown
@ 2010-06-29  6:45   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2010-06-29  6:45 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi

>>> On 28.06.10 at 20:42, Len Brown <lenb@kernel.org> wrote:
> On Thu, 24 Jun 2010, Jan Beulich wrote:
> 
>> The conditional modified (to have an 'else' portion) in commit
>> 2671717265ae6e720a9ba5f13fbec3a718983b65 degenerates to an
>> unconditional NULL dereference when CONFIG_CPU_IDLE is off, as
>> cpuidle_register_driver() returns non-zero in this case, and
>> cpu_idle_get_driver() returns NULL. The simplest solution is to make
>> the whole construct depend on CONFIG_CPU_IDLE bein defined.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
> As CONFIG_ACPI selects CONFIG_CPU_IDLE,
> how were you able to provoke this issue?

Oh, indeed, I forgot that it's a specific of our kernels that the select
is a conditional one. Sorry for the noise then.

Jan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-29  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-24 14:40 [PATCH] acpi/processor: fix for !CONFIG_CPU_IDLE Jan Beulich
2010-06-28 18:42 ` Len Brown
2010-06-29  6:45   ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox