PM / Freezer: fix return value of freezable_schedule_timeout_killable()
authorJeff Layton <jlayton@redhat.com>
Sun, 25 Dec 2011 23:29:55 +0000 (00:29 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Tue, 27 Dec 2011 00:06:33 +0000 (01:06 +0100)
...it should return the return code from schedule_timeout_killable(),
not the one from freezer_count().

All of the current callers ignore the return code so the bug is
harmless but it's worth fixing.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
include/linux/freezer.h

index 7bcfe73d999b351eca24c36a70d0f2398f1e59d5..0ab54e16a91f499b37db61fcd2be564232144a4a 100644 (file)
@@ -116,9 +116,11 @@ static inline int freezer_should_skip(struct task_struct *p)
 /* Like schedule_timeout_killable(), but should not block the freezer. */
 #define freezable_schedule_timeout_killable(timeout)                   \
 ({                                                                     \
+       long __retval;                                                  \
        freezer_do_not_count();                                         \
-       schedule_timeout_killable(timeout);                             \
+       __retval = schedule_timeout_killable(timeout);                  \
        freezer_count();                                                \
+       __retval;                                                       \
 })
 
 /*