Skip to content

Commit b086162

Browse files
taoyuhonglijinxia
authored andcommitted
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>
1 parent a86a25f commit b086162

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

devicemodel/core/monitor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ static void handle_resume(struct mngr_msg *msg, int client_fd, void *param)
168168
ack.msgid = msg->msgid;
169169
ack.timestamp = msg->timestamp;
170170

171+
wakeup_reason = msg->data.reason;
172+
171173
LIST_FOREACH(ops, &vm_ops_head, list) {
172174
if (ops->ops->resume) {
173175
ret += ops->ops->resume(ops->arg);
@@ -181,8 +183,6 @@ static void handle_resume(struct mngr_msg *msg, int client_fd, void *param)
181183
} else
182184
ack.data.err = ret;
183185

184-
wakeup_reason = msg->data.reason;
185-
186186
mngr_send_msg(client_fd, &ack, NULL, ACK_TIMEOUT);
187187
}
188188

0 commit comments

Comments
 (0)