Skip to content
Commit b7dcc4ea authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Thomas Gleixner
Browse files

clocksource/drivers: Fix uninitialized variable use in timer_of_init



If none of the flags are set, 'ret' is uninitialized as pointed out
by gcc:

drivers/clocksource/timer-of.c: In function 'timer_of_init':
drivers/clocksource/timer-of.c:160:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Since calling the function without any of the flags is an error,
set the return value to -EINVAL for that case.

[ tglx: Get rid of the silly backwards goto while at it ]

Fixes: dc11bae7 ("clocksource/drivers: Add timer-of common init routine")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: http://lkml.kernel.org/r/20170621215005.3870011-1-arnd@arndb.de
parent 17d9d687
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