Skip to content

Commit

Permalink
mtd: Disable mtdchar mmap on MMU systems
Browse files Browse the repository at this point in the history
commit f5cf8f0 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>
  • Loading branch information
David Woodhouse authored and Greg Kroah-Hartman committed Apr 17, 2013
1 parent f0776cd commit c6c8807
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,11 @@ static int mtd_mmap(struct file *file, struct vm_area_struct *vma)
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);
Expand Down

0 comments on commit c6c8807

Please sign in to comment.