diff options
-rw-r--r-- | mm/filemap_xip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c index 0c04615651b7..427dfe3ce78c 100644 --- a/mm/filemap_xip.c +++ b/mm/filemap_xip.c | |||
@@ -89,8 +89,8 @@ do_xip_mapping_read(struct address_space *mapping, | |||
89 | } | 89 | } |
90 | } | 90 | } |
91 | nr = nr - offset; | 91 | nr = nr - offset; |
92 | if (nr > len) | 92 | if (nr > len - copied) |
93 | nr = len; | 93 | nr = len - copied; |
94 | 94 | ||
95 | error = mapping->a_ops->get_xip_mem(mapping, index, 0, | 95 | error = mapping->a_ops->get_xip_mem(mapping, index, 0, |
96 | &xip_mem, &xip_pfn); | 96 | &xip_mem, &xip_pfn); |