aboutsummaryrefslogtreecommitdiff
path: root/src/mixer_plugin.c
diff options
context:
space:
mode:
authorRohit kumar <rohitkr@codeaurora.org>2020-06-02 11:41:13 +0530
committerRohit kumar <rohitkr@codeaurora.org>2020-06-02 12:31:19 +0530
commitdf855e804886f2846d0bdb6d8b1aad506452f051 (patch)
tree025019e5ad3288ccc6e072f5a9b01caf9ea66fd0 /src/mixer_plugin.c
parentf38405c4fd804fc3482055f1345095343ef243c5 (diff)
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.
Diffstat (limited to 'src/mixer_plugin.c')
-rw-r--r--src/mixer_plugin.c2
1 files changed, 1 insertions, 1 deletions
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 @@ static int mixer_plug_info_integer(struct snd_control *ctl,
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.