]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Apr 2013 22:37:14 +0000 (15:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Apr 2013 22:37:14 +0000 (15:37 -0700)
added patches:
mtd-disable-mtdchar-mmap-on-mmu-systems.patch

queue-3.0/mtd-disable-mtdchar-mmap-on-mmu-systems.patch [new file with mode: 0644]
queue-3.0/series

diff --git a/queue-3.0/mtd-disable-mtdchar-mmap-on-mmu-systems.patch b/queue-3.0/mtd-disable-mtdchar-mmap-on-mmu-systems.patch
new file mode 100644 (file)
index 0000000..ee5c7c5
--- /dev/null
@@ -0,0 +1,34 @@
+From f5cf8f07423b2677cebebcebc863af77223a4972 Mon Sep 17 00:00:00 2001
+From: David Woodhouse <David.Woodhouse@intel.com>
+Date: Tue, 9 Oct 2012 15:08:10 +0100
+Subject: mtd: Disable mtdchar mmap on MMU systems
+
+From: David Woodhouse <David.Woodhouse@intel.com>
+
+commit f5cf8f07423b2677cebebcebc863af77223a4972 upstream.
+
+This code was broken because it assumed that all MTD devices were map-based.
+Disable it for now, until it can be fixed properly for the next merge window.
+
+Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/mtdchar.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/mtd/mtdchar.c
++++ b/drivers/mtd/mtdchar.c
+@@ -1103,7 +1103,11 @@ static int mtd_mmap(struct file *file, s
+       resource_size_t start, off;
+       unsigned long len, vma_len;
+-      if (mtd->type == MTD_RAM || mtd->type == MTD_ROM) {
++        /* This is broken because it assumes the MTD device is map-based
++         and that mtd->priv is a valid struct map_info.  It should be
++         replaced with something that uses the mtd_get_unmapped_area()
++         operation properly. */
++      if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/) {
+               off = get_vm_offset(vma);
+               start = map->phys;
+               len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size);
index 1378040ce57822f63058b008b99f4d5cb6233c36..f9cf51db4f641b1a782e4fa4f4f71bc08a65cc37 100644 (file)
@@ -9,3 +9,4 @@ x86-mm-paravirt-fix-vmalloc_fault-oops-during-lazy-mmu-updates.patch
 x86-mm-patch-out-arch_flush_lazy_mmu_mode-when-running-on-bare-metal.patch
 mtdchar-fix-offset-overflow-detection.patch
 r8169-fix-auto-speed-down-issue.patch
+mtd-disable-mtdchar-mmap-on-mmu-systems.patch