From: Shawn Lin Date: Thu, 10 Mar 2016 06:52:27 +0000 (+0800) Subject: UPSTREAM: spi: rockchip: covert rsd_nsecs to u32 type X-Git-Tag: firefly_0821_release~2438 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5edbaec5862c45d7f74da2c117063e7359ad80a5;p=firefly-linux-kernel-4.4.55.git UPSTREAM: spi: rockchip: covert rsd_nsecs to u32 type rsd_nsecs is defined as u8 memeber of struct rockchip_spi, but using of_property_read_u32. That means we take risk of truncation by type conversion if we pass on big value from dt. Change-Id: I4d3e29b64749ac8a86782413d0f41691b9ff4e84 Signed-off-by: Shawn Lin Signed-off-by: Mark Brown Signed-off-by: Caesar Wang (cherry picked from git.kernel.org next/linux-next.git master commit 108b5c8bba6be101100596bf37a165214e1c8458) --- diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 7a4a131cdbd8..26e2688c104e 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -173,7 +173,7 @@ struct rockchip_spi { u8 tmode; u8 bpw; u8 n_bytes; - u8 rsd_nsecs; + u32 rsd_nsecs; unsigned len; u32 speed;