[S390] 3270: fix race with stack local wait_queue_head_t.

A wait_event call with a stack local wait_queue_head_t structure that is
used to do the wake up for the wait_event is inherently racy. After the
wait_event finished the wake_up call might not have completed yet.
Remove the stack local wait_queue_head_t from raw3270_start_init and
use the global raw3270_wait_queue instead.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

+4 -5
+4 -5
drivers/s390/char/raw3270.c
··· 549 549 struct raw3270_request *rq) 550 550 { 551 551 unsigned long flags; 552 - wait_queue_head_t wq; 553 552 int rc; 554 553 555 554 #ifdef CONFIG_TN3270_CONSOLE ··· 565 566 return rq->rc; 566 567 } 567 568 #endif 568 - init_waitqueue_head(&wq); 569 569 rq->callback = raw3270_wake_init; 570 - rq->callback_data = &wq; 570 + rq->callback_data = &raw3270_wait_queue; 571 571 spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags); 572 572 rc = __raw3270_start(rp, view, rq); 573 573 spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags); 574 574 if (rc) 575 575 return rc; 576 576 /* Now wait for the completion. */ 577 - rc = wait_event_interruptible(wq, raw3270_request_final(rq)); 577 + rc = wait_event_interruptible(raw3270_wait_queue, 578 + raw3270_request_final(rq)); 578 579 if (rc == -ERESTARTSYS) { /* Interrupted by a signal. */ 579 580 raw3270_halt_io(view->dev, rq); 580 581 /* No wait for the halt to complete. */ 581 - wait_event(wq, raw3270_request_final(rq)); 582 + wait_event(raw3270_wait_queue, raw3270_request_final(rq)); 582 583 return -ERESTARTSYS; 583 584 } 584 585 return rq->rc;