If attrib is freed in cmd->func(), then it will be used if either
request or response queue has some data to send.
This patch moves calling wake_up_sender() which increases the ref
count of attrib so that it wont get freed in cmd->func().
status = 0;
done:
+ if (!g_queue_is_empty(attrib->requests) ||
+ !g_queue_is_empty(attrib->responses))
+ wake_up_sender(attrib);
+
if (cmd) {
if (cmd->func)
cmd->func(status, buf, len, cmd->user_data);
command_destroy(cmd);
}
- if (!g_queue_is_empty(attrib->requests) ||
- !g_queue_is_empty(attrib->responses))
- wake_up_sender(attrib);
-
return TRUE;
}