Commit e738216b authored by Matthias Braun's avatar Matthias Braun
Browse files

fix read from uninitialized memory

[r26318]
parent d2c1b019
......@@ -79,7 +79,8 @@ void timing_enter_max_prio(void)
if (res < 0)
return;
new_scheduler = SCHED_FIFO;
sched_params.sched_priority = sched_get_priority_max(new_scheduler);
new_sched_params = sched_params;
new_sched_params.sched_priority = sched_get_priority_max(new_scheduler);
sched_setscheduler(0, new_scheduler, &new_sched_params);
if (res < 0)
return;
......
......@@ -53,7 +53,7 @@ static __inline timing_ticks_t __timing_ticks(void) { __asm { rdtsc } }
typedef struct timeval timing_ticks_t;
#define timing_ticks(t) (gettimeofday(&(t), NULL))
#define timing_ticks_init(t) ((t).tv_sec = 0, (t).tv_usec = 0)
#define timing_ticks_init(t) memset((t), 0, sizeof(t))
/*
* This shamelessly stolen and modified from glibc's
......
......@@ -62,7 +62,7 @@ extern int stat_ev_timer_sp;
extern timing_ticks_t stat_ev_timer_elapsed[];
extern timing_ticks_t stat_ev_timer_start[];
static inline __attribute__((unused)) void stat_ev_tim_push(void) {
static inline void stat_ev_tim_push(void) {
timing_ticks_t temp;
int sp = stat_ev_timer_sp++;
timing_ticks(temp);
......@@ -76,7 +76,7 @@ static inline __attribute__((unused)) void stat_ev_tim_push(void) {
timing_ticks(stat_ev_timer_start[sp]);
}
static inline __attribute__((unused)) void stat_ev_tim_pop(const char *name) {
static inline void stat_ev_tim_pop(const char *name) {
int sp;
timing_ticks_t temp;
timing_ticks(temp);
......
Markdown is supported
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