Commit b31459ad authored by Jon Medhurst's avatar Jon Medhurst Committed by Russell King

ARM: 7917/1: cacheflush: correctly limit range of memory region being flushed

The __do_cache_op function operates with a 'chunk' size of one page
but fails to limit the size of the final chunk so as to not exceed
the specified memory region. Fix this.

Cc: <stable@vger.kernel.org>
Reported-by: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarJon Medhurst <tixy@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 3abb6671
...@@ -509,9 +509,10 @@ static inline int ...@@ -509,9 +509,10 @@ static inline int
__do_cache_op(unsigned long start, unsigned long end) __do_cache_op(unsigned long start, unsigned long end)
{ {
int ret; int ret;
unsigned long chunk = PAGE_SIZE;
do { do {
unsigned long chunk = min(PAGE_SIZE, end - start);
if (signal_pending(current)) { if (signal_pending(current)) {
struct thread_info *ti = current_thread_info(); struct thread_info *ti = current_thread_info();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment