From: Zhang Rui <rui.zhang@intel.com>
To: Michel Lespinasse <walken@google.com>
Cc: linux-acpi@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: ACPI fan driver: uninitialized variable when CONFIG_PM is not set
Date: Thu, 16 May 2013 09:07:23 +0800 [thread overview]
Message-ID: <1368666443.2063.22.camel@rzhang1-mobl4> (raw)
In-Reply-To: <CANN689GoQm8dGEN6L1xuuc_aZ_65G3N7tBPbEXHjAfebB7xrLw@mail.gmail.com>
Hi, Michel,
On Mon, 2013-04-29 at 05:32 -0700, Michel Lespinasse wrote:
> 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 :)
>
thanks for your report.
please check if the following patch helps or not.
https://patchwork.kernel.org/patch/2574691/
thanks,
rui
next prev parent reply other threads:[~2013-05-16 1:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 12:32 Michel Lespinasse
2013-05-16 1:07 ` Zhang Rui [this message]
2013-05-16 7:56 ` Michel Lespinasse
2013-05-16 8:47 ` Rafael J. Wysocki
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=1368666443.2063.22.camel@rzhang1-mobl4 \
--to=rui.zhang@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=walken@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®