Files
linux/drivers
Colin Ian King 0c60045656 rtc: tx4939: avoid unintended sign extension on a 24 bit shift
[ Upstream commit 347876ad47 ]

The shifting of buf[5] by 24 bits to the left will be promoted to
a 32 bit signed int and then sign-extended to an unsigned long. If
the top bit of buf[5] is set then all then all the upper bits sec
end up as also being set because of the sign-extension. Fix this by
casting buf[5] to an unsigned long before the shift.

Detected by CoverityScan, CID#1465292 ("Unintended sign extension")

Fixes: 0e1492330c ("rtc: add rtc-tx4939 driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25 16:13:15 +02:00
..
2018-05-16 10:08:44 +02:00
2018-02-25 11:05:55 +01:00
2018-04-13 19:48:17 +02:00
2017-09-09 17:39:41 +02:00
2018-04-13 19:48:22 +02:00
2018-04-13 19:48:23 +02:00
2018-04-13 19:48:13 +02:00