staging: lustre: handle error returned from wait_event_timeout seltest timer
authorJames Simmons <jsimmons@infradead.org>
Sat, 12 Mar 2016 18:00:33 +0000 (13:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
The function wait_event_timeout can fail and return an error. Handle
this case in stt_timer_main().

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/selftest/timer.c

index 8be52526ae5a8f6ea088bddabbbd5173637c5985..ef8a8a748cbe9e0ec7289c0f6c3acccf39cc5a40 100644 (file)
@@ -170,20 +170,22 @@ stt_check_timers(unsigned long *last)
 static int
 stt_timer_main(void *arg)
 {
+       int rc = 0;
+
        cfs_block_allsigs();
 
        while (!stt_data.stt_shuttingdown) {
                stt_check_timers(&stt_data.stt_prev_slot);
 
-               wait_event_timeout(stt_data.stt_waitq,
-                                  stt_data.stt_shuttingdown,
-                                  cfs_time_seconds(STTIMER_SLOTTIME));
+               rc = wait_event_timeout(stt_data.stt_waitq,
+                                       stt_data.stt_shuttingdown,
+                                       cfs_time_seconds(STTIMER_SLOTTIME));
        }
 
        spin_lock(&stt_data.stt_lock);
        stt_data.stt_nthreads--;
        spin_unlock(&stt_data.stt_lock);
-       return 0;
+       return rc;
 }
 
 static int