milkymist-pfpu: fix potential integer overflow
PATCH 1/1 milkymist-pfpu: fix potential integer overflow
Since the lm32 is a 32 bit architecture, just return a 32 bit value which is then converted to a 64 bit value.
Spotted by coverity, CID 1005506.
Signed-off-by Michael Walle <[email protected]>
--- hw/misc/milkymist-pfpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/milkymist-pfpu.c +1 -1
@@ -137,7 +137,7 @@ struct MilkymistPFPUState { };typedef struct MilkymistPFPUState MilkymistPFPUState ; -static inline hwaddr +static inline uint32_t get_dma_address (uint32_t base,uint32_t x,uint32_t y) {return base +8 * (128 * y + x);
Signature · 1 line
2.1.4
Michael Tokarev
AppliedQuoted 4 lines · Michael Walle
Since the lm32 is a 32 bit architecture, just return a 32 bit value which is then converted to a 64 bit value.
Spotted by coverity, CID 1005506.
Applied to -trivial, thank you!
/mjt