rfcomm, sched/wait: Fix broken wait construct
authorPeter Zijlstra <peterz@infradead.org>
Wed, 29 Oct 2014 15:17:12 +0000 (16:17 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Nov 2014 06:17:47 +0000 (07:17 +0100)
commiteedf7e47daa0b8530246a8c9107c007fbf8231bf
treee945f8690e964eb998089519a8aff192e090f494
parent6b55fc63f46ba299f3d84013e9232be4bd259eab
rfcomm, sched/wait: Fix broken wait construct

rfcomm_run() is a tad broken in that is has a nested wait loop. One
cannot rely on p->state for the outer wait because the inner wait will
overwrite it.

Fix this using the new wait_woken() facility.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Alexander Holler <holler@ahsoftware.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Joe Perches <joe@perches.com>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Libor Pechacek <lpechacek@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Vignesh Raman <Vignesh_Raman@mentor.com>
Cc: linux-bluetooth@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
net/bluetooth/rfcomm/core.c