lkml.org 
[lkml]   [2013]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectACPI fan driver: uninitialized variable when CONFIG_PM is not set
From
In the following code:

static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long
*state)
{
struct acpi_device *device = cdev->devdata;
int result;
int acpi_state;

if (!device)
return -EINVAL;

result = acpi_bus_update_power(device->handle, &acpi_state);
if (result)
return result;

*state = (acpi_state == ACPI_STATE_D3 ? 0 :
(acpi_state == ACPI_STATE_D0 ? 1 : -1));
return 0;
}

With CONFIG_PM not set, acpi_bus_update_power() returns 0 and does not
initialize acpi_state. This results in acpi_state being used before
initialization.

(I found out by random chance, as I suppose people don't normally
build without CONFIG_PM anymore ?)

I'm not sure what a proper fix would be, so I'll just report this here
and enable CONFIG_PM locally :)

--
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.


\
 
 \ /
  Last update: 2013-04-29 15:01    [W:0.247 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site