From 4d508e2f0967ccdfd70d3b1665ea8027aa98e8b9 Mon Sep 17 00:00:00 2001 From: Hajime Tazaki Date: Tue, 14 Jul 2015 17:37:15 +0900 Subject: [PATCH] lib: add sanity check for internal table deletion Signed-off-by: Hajime Tazaki --- arch/lib/timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/lib/timer.c b/arch/lib/timer.c index eb1ab004d693..0c9a78defd40 100644 --- a/arch/lib/timer.c +++ b/arch/lib/timer.c @@ -191,7 +191,9 @@ int del_timer(struct timer_list *timer) l_timer = lib_timer_find(timer); if (l_timer != NULL && l_timer->event != NULL) { lib_event_cancel(l_timer->event); - hlist_del(&l_timer->t_hash); + + if (l_timer->t_hash.next != LIST_POISON1) + hlist_del(&l_timer->t_hash); lib_free(l_timer); retval = 1; } else {