msm: subsystem-restart: Fixup variable declaration
A variable in do_epoch_check could possibly be
uninitialized when it gets used, so initalize to NULL
and check for failure.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/arch/arm/mach-msm/subsystem_restart.c b/arch/arm/mach-msm/subsystem_restart.c
index fef65ff..aa0f3cc 100644
--- a/arch/arm/mach-msm/subsystem_restart.c
+++ b/arch/arm/mach-msm/subsystem_restart.c
@@ -242,7 +242,7 @@
static void do_epoch_check(struct subsys_data *subsys)
{
int n = 0;
- struct timeval *time_first, *curr_time;
+ struct timeval *time_first = NULL, *curr_time;
struct restart_log *r_log, *temp;
static int max_restarts_check;
static long max_history_time_check;
@@ -283,7 +283,7 @@
pr_debug("restart_time: %ld\n", r_log->time.tv_sec);
}
- if (n >= max_restarts_check) {
+ if (time_first && n >= max_restarts_check) {
if ((curr_time->tv_sec - time_first->tv_sec) <
max_history_time_check)
panic("Subsystems have crashed %d times in less than "