Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76ae0536 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

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: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@osdl.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 74aeac4d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
			}