mixer: Fix memory leak and other issues in mixer event
Fix memory leak in mixer_wait_event(). Also, poll should be
unblocked after increasing event_cnt in mixer_plugin, otherwise
event_cnt can become negative during read_event. Fix the same.
diff --git a/src/mixer_plugin.c b/src/mixer_plugin.c
index 389003e..9f22b7e 100644
--- a/src/mixer_plugin.c
+++ b/src/mixer_plugin.c
@@ -137,8 +137,8 @@
void mixer_plug_notifier_cb(struct mixer_plugin *plugin)
{
- eventfd_write(plugin->eventfd, 1);
plugin->event_cnt++;
+ eventfd_write(plugin->eventfd, 1);
}
/* In consume_event/read, do not call eventfd_read until all events are read from list.