[PATCH] USB: Prevent hiddev from looping

Linux Kernel Mailing List <[email protected]>
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1576, 2005/01/27 07:28:42-02:00, [email protected]

	[PATCH] USB: Prevent hiddev from looping
	
	In the loop, schedule() returns with the current state TASK_RUNNING, so at the
	next revolution it returns immediately, and the task sits there burning CPU.
	
	The fix is to add the forgotten state assignment.
	
	Patch from David Micon.



 hiddev.c |    1 +
 1 files changed, 1 insertion(+)


diff -Nru a/drivers/usb/hiddev.c b/drivers/usb/hiddev.c
--- a/drivers/usb/hiddev.c	2005-01-30 15:36:34 -08:00
+++ b/drivers/usb/hiddev.c	2005-01-30 15:36:34 -08:00
@@ -328,6 +328,7 @@
 				}
 				
 				schedule();
+				set_current_state(TASK_INTERRUPTIBLE);
 			}
 
 			set_current_state(TASK_RUNNING);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.