projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
322a8b0
)
alarmtimers: Avoid possible null pointer traversal
author
John Stultz
<
[email protected]
>
Thu, 4 Aug 2011 14:25:35 +0000
(07:25 -0700)
committer
John Stultz
<
[email protected]
>
Wed, 10 Aug 2011 14:09:53 +0000
(07:09 -0700)
We don't check if old_setting is non null before assigning it, so
correct this.
CC: Thomas Gleixner <
[email protected]
>
CC:
[email protected]
Signed-off-by: John Stultz <
[email protected]
>
kernel/time/alarmtimer.c
patch
|
blob
|
history
diff --git
a/kernel/time/alarmtimer.c
b/kernel/time/alarmtimer.c
index 59f369f98a04311f5bfa49d01e706d4b12ca97c4..1dee3f62a6a7d77837a10382b6e106bc0b85f65d 100644
(file)
--- a/
kernel/time/alarmtimer.c
+++ b/
kernel/time/alarmtimer.c
@@
-479,11
+479,8
@@
static int alarm_timer_set(struct k_itimer *timr, int flags,
if (!rtcdev)
return -ENOTSUPP;
- /* Save old values */
- old_setting->it_interval =
- ktime_to_timespec(timr->it.alarmtimer.period);
- old_setting->it_value =
- ktime_to_timespec(timr->it.alarmtimer.node.expires);
+ if (old_setting)
+ alarm_timer_get(timr, old_setting);
/* If the timer was already set, cancel it */
alarm_cancel(&timr->it.alarmtimer);