Commit 061d2c1d authored by Shubhrajyoti Datta's avatar Shubhrajyoti Datta Committed by Michal Simek
Browse files

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: default avatarShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent 2602276d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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)