Skip to content

Commit

Permalink
lib: add sanity check for internal table deletion
Browse files Browse the repository at this point in the history
Signed-off-by: Hajime Tazaki <tazaki@sfc.wide.ad.jp>
  • Loading branch information
thehajime committed Jul 14, 2015
1 parent 576b8d7 commit 4d508e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/lib/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4d508e2

Please sign in to comment.