Add patch to fix oops when removing wmi module (rhbz 706574)

This commit is contained in:
Josh Boyer 2011-11-02 09:55:36 -04:00
parent 58cf40bfda
commit 18db0fc8c6
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,41 @@
From 023b9565972a4a5e0f01b9aa32680af6e9b5c388 Mon Sep 17 00:00:00 2001
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Wed, 7 Sep 2011 15:00:02 -0700
Subject: [PATCH] WMI: properly cleanup devices to avoid crashes
We need to remove devices that we destroy from the list, otherwise
we'll crash if there are more than one "_WDG" methods in DSDT.
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=32052
Tested-by: Ilya Tumaykin <librarian_rus@yahoo.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
drivers/platform/x86/wmi.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index f23d5a8..9b88be4 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -754,9 +754,13 @@ static void wmi_free_devices(void)
struct wmi_block *wblock, *next;
/* Delete devices for all the GUIDs */
- list_for_each_entry_safe(wblock, next, &wmi_block_list, list)
+ list_for_each_entry_safe(wblock, next, &wmi_block_list, list) {
+ list_del(&wblock->list);
if (wblock->dev.class)
device_unregister(&wblock->dev);
+ else
+ kfree(wblock);
+ }
}
static bool guid_already_parsed(const char *guid_string)
--
1.7.6.4

View File

@ -51,7 +51,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be prepended with "0.", so
# for example a 3 here will become 0.3
#
%global baserelease 7
%global baserelease 8
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@ -765,6 +765,9 @@ Patch21050: xfs-Fix-possible-memory-corruption-in-xfs_readlink.patch
Patch21070: oom-fix-integer-overflow-of-points.patch
#rhbz 706574
Patch21071: WMI-properly-cleanup-devices-to-avoid-crashes.patch
%endif
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@ -1410,6 +1413,9 @@ ApplyPatch benet-remove-bogus-unlikely-on-vlan-check.patch
#rhbz 750402
ApplyPatch oom-fix-integer-overflow-of-points.patch
#rhbz 706574
ApplyPatch WMI-properly-cleanup-devices-to-avoid-crashes.patch
# END OF PATCH APPLICATIONS
%endif
@ -2111,6 +2117,9 @@ fi
# and build.
%changelog
* Wed Nov 02 2011 Josh Boyer <jwboyer@redhat.com>
- Add patch to fix oops when removing wmi module (rhbz 706574)
* Tue Nov 01 2011 Dave Jones <davej@redhat.com> 3.1.0-8
- allow building the perf rpm for ARM (rhbz 741325)