aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-10 10:22:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-10 10:22:35 -0400
commit977b58e1dd6fc2a751fb427798bfb8256476c93e (patch)
treeee71723ccffda6d183652266134f623d9541d76f /fs
parentf5b8fcb48b9eb1a02f6a3a679da913f6c467527c (diff)
parent2842e5b00e99b30404f9af1c1b367c8e467b5c6c (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
Pull m68knommu updates from Greg Ungerer: "The bulk of the changes are generalizing the ColdFire v3 core support and adding in 537x CPU support. Also a couple of other bug fixes, one to fix a reintroduction of a past bug in the romfs filesystem nommu support." * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68knommu: enable Timer on coldfire 532x m68knommu: fix ColdFire 5373/5329 QSPI base address m68knommu: add support for configuring a Freescale M5373EVB board m68knommu: add support for the ColdFire 537x family of CPUs m68knommu: make ColdFire M532x platform support more v3 generic m68knommu: create and use a common M53xx ColdFire class of CPUs m68k: remove unused asm/dbg.h m68k: Set ColdFire ACR1 cache mode depending on kernel configuration romfs: fix nommu map length to keep inside filesystem m68k: clean up unused "config ROMVECSIZE"
Diffstat (limited to 'fs')
-rw-r--r--fs/romfs/mmap-nommu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/romfs/mmap-nommu.c b/fs/romfs/mmap-nommu.c
index e1a7779dd3cb..f373bde8f545 100644
--- a/fs/romfs/mmap-nommu.c
+++ b/fs/romfs/mmap-nommu.c
@@ -49,8 +49,11 @@ static unsigned long romfs_get_unmapped_area(struct file *file,
49 return (unsigned long) -EINVAL; 49 return (unsigned long) -EINVAL;
50 50
51 offset += ROMFS_I(inode)->i_dataoffset; 51 offset += ROMFS_I(inode)->i_dataoffset;
52 if (offset > mtd->size - len) 52 if (offset >= mtd->size)
53 return (unsigned long) -EINVAL; 53 return (unsigned long) -EINVAL;
54 /* the mapping mustn't extend beyond the EOF */
55 if ((offset + len) > mtd->size)
56 len = mtd->size - offset;
54 57
55 ret = mtd_get_unmapped_area(mtd, len, offset, flags); 58 ret = mtd_get_unmapped_area(mtd, len, offset, flags);
56 if (ret == -EOPNOTSUPP) 59 if (ret == -EOPNOTSUPP)