From fc02477e1c4ff69f56db3f902907e881d927e2d3 Mon Sep 17 00:00:00 2001 From: Qing Li Date: Thu, 22 Oct 2009 00:32:01 +0000 Subject: [PATCH] Verify "smp_started" is true before calling sched_bind() and sched_unbind(). Reviewed by: kmacy MFC after: 3 days --- sys/net/flowtable.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/net/flowtable.c b/sys/net/flowtable.c index 31c2acc19a9..3ed0528dd28 100644 --- a/sys/net/flowtable.c +++ b/sys/net/flowtable.c @@ -963,15 +963,19 @@ flowtable_clean_vnet(void) if (CPU_ABSENT(i)) continue; - thread_lock(curthread); - sched_bind(curthread, i); - thread_unlock(curthread); + if (smp_started == 1) { + thread_lock(curthread); + sched_bind(curthread, i); + thread_unlock(curthread); + } flowtable_free_stale(ft, NULL); - thread_lock(curthread); - sched_unbind(curthread); - thread_unlock(curthread); + if (smp_started == 1) { + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); + } } } else { flowtable_free_stale(ft, NULL);