aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bitmap.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <[email protected]>2008-05-12 21:02:24 +0000
committerLinus Torvalds <[email protected]>2008-05-13 15:02:25 +0000
commit945185a69daa457c4c5e46e47f4afad7dcea734f (patch)
tree688be6d624632b5538c925ac278511ea2aa79f02 /lib/bitmap.c
parentm68knommu: missing sections for linker script (diff)
downloadkernel-945185a69daa457c4c5e46e47f4afad7dcea734f.tar.gz
kernel-945185a69daa457c4c5e46e47f4afad7dcea734f.zip
rtc: rtc_time_to_tm: use unsigned arithmetic
The input argument to rtc_time_to_tm() is unsigned as well as are members of the output structure. However signed arithmetic is used within for calculations leading to incorrect results for input values outside the signed positive range. If this happens the time of day returned is out of range. Found the problem when fiddling with the RTC and the driver where year was set to an unexpectedly large value like 2070, e.g.: rtc0: setting system clock to 2070-01-01 1193046:71582832:26 UTC (3155760954) while it should be: rtc0: setting system clock to 2070-01-01 00:15:54 UTC (3155760954) Changing types to unsigned fixes the problem. [[email protected]: remove old-fashioned `register' keyword] Signed-off-by: Maciej W. Rozycki <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: David Brownell <[email protected]> Cc: Dmitri Vorobiev <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/bitmap.c')
0 files changed, 0 insertions, 0 deletions