[PATCH] drivers/atm/firestream.c: convert interruptible_sleep_on() From: irwan.djajadi@iname.com Replace interruptible_sleep_on() with wait_event_interruptible(). Also, reorder wake_up_interruptible() to prevent race condition. Signed-off-by: Irwan Djajadi Signed-off-by: Alexey Dobriyan Index: linux-kj/drivers/atm/firestream.c =================================================================== --- linux-kj.orig/drivers/atm/firestream.c 2005-12-05 13:19:48.000000000 +0300 +++ linux-kj/drivers/atm/firestream.c 2005-12-05 13:20:11.000000000 +0300 @@ -734,8 +734,8 @@ static void process_txdone_queue (struct skb = td->skb; if (skb == FS_VCC (ATM_SKB(skb)->vcc)->last_skb) { - wake_up_interruptible (& FS_VCC (ATM_SKB(skb)->vcc)->close_wait); FS_VCC (ATM_SKB(skb)->vcc)->last_skb = NULL; + wake_up_interruptible (& FS_VCC (ATM_SKB(skb)->vcc)->close_wait); } td->dev->ntxpckts--; @@ -1113,10 +1113,10 @@ static void fs_close(struct atm_vcc *atm be impolite not to send them don't you think? XXX We don't know which packets didn't get sent. So if we get interrupted in - this sleep_on, we'll lose any reference to these packets. Memory leak! + this wait_event, we'll lose any reference to these packets. Memory leak! On the other hand, it's awfully convenient that we can abort a "close" that is taking too long. Maybe just use non-interruptible sleep on? -- REW */ - interruptible_sleep_on (& vcc->close_wait); + wait_event_interruptible (vcc->close_wait, !vcc->last_skb); } txtp = &atm_vcc->qos.txtp;