nvmem: fix possible integer overflow in nintendo_otp_reg_read()
PATCH 1/1 nvmem: fix possible integer overflow in nintendo_otp_reg_read()
bytes of type size_t is passed to words of type int in nintendo_otp_reg_read. This can lead to integer overflow.
Signed-off-by Hangyu Hua <[email protected]>
--- drivers/nvmem/nintendo-otp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/nintendo-otp.c +1 -1
@@ -50,7 +50,7 @@ static int nintendo_otp_reg_read(void *context, {struct nintendo_otp_priv *priv = context;u32 *val = _val; -int words = bytes /WORD_SIZE ; +size_t words = bytes /WORD_SIZE ;u32 bank, addr;while (words--) {
Signature · 1 line
2.25.1