mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
microblaze: Prevent the overflow of the start
[ Upstream commit 061d2c1d59
]
In case the start + cache size is more than the max int the
start overflows.
Prevent the same.
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
af9be1a3b4
commit
9598feb085
1 changed files with 2 additions and 1 deletions
|
@ -92,6 +92,7 @@ static inline void __disable_dcache_nomsr(void)
|
|||
#define CACHE_LOOP_LIMITS(start, end, cache_line_length, cache_size) \
|
||||
do { \
|
||||
int align = ~(cache_line_length - 1); \
|
||||
if (start < UINT_MAX - cache_size) \
|
||||
end = min(start + cache_size, end); \
|
||||
start &= align; \
|
||||
} while (0)
|
||||
|
|
Loading…
Reference in a new issue