LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Carlos Corbacho <carlos@strangeworlds.co.uk>
To: Ingo Molnar <mingo@elte.hu>
Cc: Len Brown <lenb@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@lists.linux-foundation.org
Subject: Re: [GIT PATCH] ACPI patches for 2.6.25-rc0 (#2)
Date: Sat, 9 Feb 2008 11:42:17 +0000	[thread overview]
Message-ID: <200802091142.18596.carlos@strangeworlds.co.uk> (raw)
In-Reply-To: <20080209061936.GA16849@elte.hu>

On Saturday 09 February 2008 06:19:36 Ingo Molnar wrote:
> (Carlos Cc:-ed too)
>
> * Ingo Molnar <mingo@elte.hu> wrote:
> > * Len Brown <lenb@kernel.org> wrote:
> > > Len Brown (6):
> > >       ACPI: add newline to printk
> > >       ACPI: build WMI on X86 only
> > >       acer-wmi, tc1100-wmi: select ACPI_WMI
> >
> > hm, this new WMI code caused a bootup crash in the overnight x86.git
> > tests:

I suspect this is a problem on systems without ACPI-WMI in the DSDT - though I 
can't reproduce this here on my other box that lacks ACPI-WMI.

Ingo, can you try the patch below and see if this cures it?
---
ACPI: WMI: Fix crash on WMI free systems

From: Carlos Corbacho <carlos@strangeworlds.co.uk>

We have two pointers in the find_guid() code that aren't checked before
we use them. On ACPI-WMI free systems, this can sometimes cause a crash if
another driver tries to use any of the methods provided by WMI.

Also throw in an extra early check to see if the GUID list is empty, so we
can try to bail out before reaching this code as well.

Spotted by Ingo Molnar.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
CC: Ingo Molnar <mingo@elte.hu>
CC: Linus Torvalds <torvalds@linux-foundation.org>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Len Brown <lenb@kernel.org>
---

 drivers/acpi/wmi.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)


diff --git a/drivers/acpi/wmi.c b/drivers/acpi/wmi.c
index 36b84ab..b54e734 100644
--- a/drivers/acpi/wmi.c
+++ b/drivers/acpi/wmi.c
@@ -201,12 +201,20 @@ static bool find_guid(const char *guid_string, struct wmi_block **out)
 	struct guid_block *block;
 	struct list_head *p;
 
+	if (list_empty(&wmi_blocks.list))
+		return 0;
+
 	wmi_parse_guid(guid_string, tmp);
 	wmi_swap_bytes(tmp, guid_input);
 
 	list_for_each(p, &wmi_blocks.list) {
 		wblock = list_entry(p, struct wmi_block, list);
+		if (!wblock)
+			return 0;
+
 		block = &wblock->gblock;
+		if (!block)
+			return 0;
 
 		if (memcmp(block->guid, guid_input, 16) == 0) {
 			if (out)
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

  reply	other threads:[~2008-02-09 11:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08  6:45 Len Brown
2008-02-09  6:17 ` Ingo Molnar
2008-02-09  6:19   ` Ingo Molnar
2008-02-09 11:42     ` Carlos Corbacho [this message]
2008-02-11  9:17       ` Ingo Molnar
2008-02-11 19:23         ` Carlos Corbacho
2008-02-11 19:55           ` [PATCH 1/2] acer-wmi - Fail gracefully if ACPI is disabled Carlos Corbacho
2008-02-12  4:41             ` Linus Torvalds
2008-02-12 15:12               ` Ingo Molnar
2008-02-12 19:28               ` Carlos Corbacho
2008-02-11 19:55           ` [PATCH 2/2] tc1100-wmi " Carlos Corbacho
2008-02-14  6:11             ` Len Brown
2008-02-14  6:15               ` Len Brown

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=200802091142.18596.carlos@strangeworlds.co.uk \
    --to=carlos@strangeworlds.co.uk \
    --cc=akpm@linux-foundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [GIT PATCH] ACPI patches for 2.6.25-rc0 (#2)' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).