summaryrefslogtreecommitdiffstats
path: root/drivers/parport/share.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-02-26 12:01:49 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-28 16:22:42 -0800
commit76ae0536ddc0aa576f2aac11f0f82d0fd60b522c (patch)
tree9cec04cfa3861ccb0e4ebebeb2b7a10786ccb986 /drivers/parport/share.c
parent74aeac4da66fbfa246edbfc849002eac9b5af9ca (diff)
downloadblackbird-op-linux-76ae0536ddc0aa576f2aac11f0f82d0fd60b522c.tar.gz
blackbird-op-linux-76ae0536ddc0aa576f2aac11f0f82d0fd60b522c.zip
parport: fix interruptible_sleep_on race
The interruptible_sleep_on function is can still lead to the deadlock mentioned in the comment above the caller, and we want to remove it soon, so replace it now with the race-free wait_event_interruptible. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Andrew Morton <akpm@osdl.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/parport/share.c')
-rw-r--r--drivers/parport/share.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 6a83ee1e9178..3fa66244ce32 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -905,7 +905,8 @@ int parport_claim_or_block(struct pardevice *dev)
/* If dev->waiting is clear now, an interrupt
gave us the port and we would deadlock if we slept. */
if (dev->waiting) {
- interruptible_sleep_on (&dev->wait_q);
+ wait_event_interruptible(dev->wait_q,
+ !dev->waiting);
if (signal_pending (current)) {
return -EINTR;
}
OpenPOWER on IntegriCloud