Skip to content
Commit d0716dde authored by Sien Wu's avatar Sien Wu Committed by Mark Brown
Browse files

spi: Prevent unexpected SPI time out due to arithmetic overflow



When reading SPI flash as MTD device, the transfer length is
directly passed to the spi driver. If the requested data size
exceeds 512KB, it will cause the time out calculation to
overflow since transfer length is 32-bit unsigned integer.
This issue is resolved by using 64-bit unsigned integer
to perform the arithmetic.

Signed-off-by: default avatarSien Wu <sien.wu@ni.com>
Acked-by: default avatarBrad Keryan <brad.keryan@ni.com>
Acked-by: default avatarGratian Crisan <gratian.crisan@ni.com>
Acked-by: default avatarBrad Mouring <brad.mouring@ni.com>

Natinst-ReviewBoard-ID 150232
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 29b4817d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment