microblaze: Prevent the overflow of the start
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>
This commit is contained in:
Родитель
2602276d3d
Коммит
061d2c1d59
|
@ -92,7 +92,8 @@ static inline void __disable_dcache_nomsr(void)
|
||||||
#define CACHE_LOOP_LIMITS(start, end, cache_line_length, cache_size) \
|
#define CACHE_LOOP_LIMITS(start, end, cache_line_length, cache_size) \
|
||||||
do { \
|
do { \
|
||||||
int align = ~(cache_line_length - 1); \
|
int align = ~(cache_line_length - 1); \
|
||||||
end = min(start + cache_size, end); \
|
if (start < UINT_MAX - cache_size) \
|
||||||
|
end = min(start + cache_size, end); \
|
||||||
start &= align; \
|
start &= align; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче