dm: monotor: bugfix: update wakeup reason before call recume() callback

In handle_resume(), wakeup_reason is updated before call
ops->ops->resume(). Because ops->ops->resume() needs to know the
latest wakeup reason.

Acked-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This commit is contained in:
yuhong.tao@intel.com 2018-08-13 19:12:47 +08:00 committed by lijinxia
parent a86a25f369
commit b0861621d9
1 changed files with 2 additions and 2 deletions

View File

@ -168,6 +168,8 @@ static void handle_resume(struct mngr_msg *msg, int client_fd, void *param)
ack.msgid = msg->msgid;
ack.timestamp = msg->timestamp;
wakeup_reason = msg->data.reason;
LIST_FOREACH(ops, &vm_ops_head, list) {
if (ops->ops->resume) {
ret += ops->ops->resume(ops->arg);
@ -181,8 +183,6 @@ static void handle_resume(struct mngr_msg *msg, int client_fd, void *param)
} else
ack.data.err = ret;
wakeup_reason = msg->data.reason;
mngr_send_msg(client_fd, &ack, NULL, ACK_TIMEOUT);
}