Commit c7c58cf3 authored by Maximilian Attems's avatar Maximilian Attems Committed by Greg Kroah-Hartman

[PATCH] usb/dabusb: insert set_current_state() before schedule_timeout()

After discussing this patch with Mark Hollomon, I think it is much safer
/ better to leave the conditional check within the while loop. This way
the mutex state is as expected and maintainability is not compromised.
The previous patch should not be applied.


Description: Inserts appropriate set_current_state() call so that
schedule_timeout() functions as expected.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent cbed817c
......@@ -598,6 +598,7 @@ static int dabusb_open (struct inode *inode, struct file *file)
if (file->f_flags & O_NONBLOCK) {
return -EBUSY;
}
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout (HZ / 2);
if (signal_pending (current)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment