From: Steven Rostedt Date: Mon, 10 Oct 2005 15:13:17 +0000 (-0400) Subject: [PATCH] pcmcia: fix task state at pccard thread exit X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=220ec0291130a932b32b2c66a10e9c5019dab702;p=deliverable%2Flinux.git [PATCH] pcmcia: fix task state at pccard thread exit The pccardd thread has a race in it that it can shutdown in the TASK_INTERRUPTIBLE state. Make sure we mark ourselves runnable again as we remove ourselves from the wait queue. Signed-off-by: Steven Rostedt Signed-off-by: Linus Torvalds --- diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index fabd3529cebc..d5e76423a0ee 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c @@ -689,6 +689,9 @@ static int pccardd(void *__skt) schedule(); try_to_freeze(); } + /* make sure we are running before we exit */ + set_current_state(TASK_RUNNING); + remove_wait_queue(&skt->thread_wait, &wait); /* remove from the device core */