diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/process.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c index b9a32860bef..6d566bf7085 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -60,13 +60,16 @@ static inline void freeze_process(struct task_struct *p) unsigned long flags; if (!freezing(p)) { - if (p->state == TASK_STOPPED) - force_sig_specific(SIGSTOP, p); - - freeze(p); - spin_lock_irqsave(&p->sighand->siglock, flags); - signal_wake_up(p, p->state == TASK_STOPPED); - spin_unlock_irqrestore(&p->sighand->siglock, flags); + rmb(); + if (!frozen(p)) { + if (p->state == TASK_STOPPED) + force_sig_specific(SIGSTOP, p); + + freeze(p); + spin_lock_irqsave(&p->sighand->siglock, flags); + signal_wake_up(p, p->state == TASK_STOPPED); + spin_unlock_irqrestore(&p->sighand->siglock, flags); + } } } |