summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@redhat.com>2012-12-17 09:04:27 -0500
committerJosh Boyer <jwboyer@redhat.com>2012-12-17 09:12:27 -0500
commit0aeca8efc111136ad6291b413c3c697ed2a2436b (patch)
tree430be43971ab0018c0fc206f8950270789db0c36
parent878f7ae56d42c1a8bd402bb4f8fd9c80363e1bac (diff)
downloadkernel-0aeca8efc111136ad6291b413c3c697ed2a2436b.tar.gz
kernel-0aeca8efc111136ad6291b413c3c697ed2a2436b.tar.xz
kernel-0aeca8efc111136ad6291b413c3c697ed2a2436b.zip
Fix oops in sony-laptop setup (rhbz 873107)
-rw-r--r--0001-ACPI-sony-laptop-do-proper-memcpy-for-ACPI_TYPE_INTE.patch50
-rw-r--r--kernel.spec11
2 files changed, 60 insertions, 1 deletions
diff --git a/0001-ACPI-sony-laptop-do-proper-memcpy-for-ACPI_TYPE_INTE.patch b/0001-ACPI-sony-laptop-do-proper-memcpy-for-ACPI_TYPE_INTE.patch
new file mode 100644
index 000000000..857c73c51
--- /dev/null
+++ b/0001-ACPI-sony-laptop-do-proper-memcpy-for-ACPI_TYPE_INTE.patch
@@ -0,0 +1,50 @@
+From 690b1ad9d2032d6f2565d44f6564590d47835ae8 Mon Sep 17 00:00:00 2001
+From: Zhang Rui <rui.zhang@intel.com>
+Date: Thu, 29 Nov 2012 01:30:43 +0800
+Subject: [PATCH 1/2] ACPI sony-laptop: do proper memcpy for ACPI_TYPE_INTEGER
+ acpi_object
+
+the return value of __call_snc_method can either be
+an ACPI_TYPE_BUFFER object or a ACPI_TYPE_INTEGER object.
+do proper memcpy for ACPI_TYPE_INTEGER object.
+
+https://bugzilla.kernel.org/show_bug.cgi?id=50111
+
+Signed-off-by: Zhang Rui <rui.zhang@intel.com>
+---
+ drivers/platform/x86/sony-laptop.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
+index daaddec..92e0da2 100644
+--- a/drivers/platform/x86/sony-laptop.c
++++ b/drivers/platform/x86/sony-laptop.c
+@@ -792,20 +792,19 @@ static int sony_nc_buffer_call(acpi_handle handle, char *name, u64 *value,
+ if (!object)
+ return -EINVAL;
+
+- if (object->type == ACPI_TYPE_BUFFER)
++ if (object->type == ACPI_TYPE_BUFFER) {
+ len = MIN(buflen, object->buffer.length);
+-
+- else if (object->type == ACPI_TYPE_INTEGER)
++ memcpy(buffer, object->buffer.pointer, len);
++ } else if (object->type == ACPI_TYPE_INTEGER) {
+ len = MIN(buflen, sizeof(object->integer.value));
+-
+- else {
++ memcpy(buffer, (void *)&object->integer.value, len);
++ } else {
+ pr_warn("Invalid acpi_object: expected 0x%x got 0x%x\n",
+ ACPI_TYPE_BUFFER, object->type);
+ kfree(object);
+ return -EINVAL;
+ }
+
+- memcpy(buffer, object->buffer.pointer, len);
+ kfree(object);
+ return 0;
+ }
+--
+1.7.9.5
+
diff --git a/kernel.spec b/kernel.spec
index 73c0b643e..d0f44ce81 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -62,7 +62,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be appended after the rcX and
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
#
-%global baserelease 5
+%global baserelease 6
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@@ -773,6 +773,9 @@ Patch21233: 8139cp-re-enable-interrupts-after-tx-timeout.patch
#rhbz 883414
Patch21236: mac80211-fix-ibss-scanning.patch
+#rhbz 873107
+Patch21237: 0001-ACPI-sony-laptop-do-proper-memcpy-for-ACPI_TYPE_INTE.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1488,6 +1491,9 @@ ApplyPatch 8139cp-re-enable-interrupts-after-tx-timeout.patch
#rhbz 883414
ApplyPatch mac80211-fix-ibss-scanning.patch
+#rhbz 873107
+ApplyPatch 0001-ACPI-sony-laptop-do-proper-memcpy-for-ACPI_TYPE_INTE.patch
+
# END OF PATCH APPLICATIONS
@@ -2348,6 +2354,9 @@ fi
# ||----w |
# || ||
%changelog
+* Mon Dec 17 2012 Josh Boyer <jwboyer@redhat.com>
+- Fix oops in sony-laptop setup (rhbz 873107)
+
* Fri Dec 14 2012 Peter Robinson <pbrobinson@fedoraproject.org>
- Add patch to fix arm imx drm driver build