Skip to content

Commit

Permalink
parport: fix interruptible_sleep_on race
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
arndb authored and gregkh committed Mar 1, 2014
1 parent 74aeac4 commit 76ae053
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/parport/share.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 76ae053

Please sign in to comment.