xtensa: ISS: don't hang if stdin EOF is reached
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 8 Feb 2016 22:02:38 +0000 (01:02 +0300)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jun 2016 08:42:46 +0000 (10:42 +0200)
commitfd5924d8b354ea5a44668ce20d51cc46057e4181
tree8ee5350252b465d73d911cf7b31df65d23a9c3bc
parent929522bfe429c0f9e834c93bdcb9e6a0292245cd
xtensa: ISS: don't hang if stdin EOF is reached

commit 362014c8d9d51d504c167c44ac280169457732be upstream.

Simulator stdin may be connected to a file, when its end is reached
kernel hangs in infinite loop inside rs_poll, because simc_poll always
signals that descriptor 0 is readable and simc_read always returns 0.
Check simc_read return value and exit loop if it's not positive. Also
don't rewind polling timer if it's zero.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/xtensa/platforms/iss/console.c