[pulseaudio-commits] 4 commits - src/modules src/pulse src/pulsecore
Peter Meerwald
pmeerw at kemper.freedesktop.org
Fri Mar 10 09:19:11 UTC 2017
src/modules/oss/module-oss.c | 2 +-
src/pulse/thread-mainloop.c | 2 +-
src/pulsecore/dbus-shared.c | 4 ++--
src/pulsecore/shared.c | 2 +-
src/pulsecore/shared.h | 4 +++-
5 files changed, 8 insertions(+), 6 deletions(-)
New commits:
commit d065e4d1140f6baec4f7e2753d4b955bf8c55a95
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Tue Mar 7 21:43:41 2017 +0100
pulse: Explicitly ignore pa_mainloop_run() return value in thread function
Coverity ID: #1137975
Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
diff --git a/src/pulse/thread-mainloop.c b/src/pulse/thread-mainloop.c
index cbfc474..993b7ba 100644
--- a/src/pulse/thread-mainloop.c
+++ b/src/pulse/thread-mainloop.c
@@ -97,7 +97,7 @@ static void thread(void *userdata) {
pa_mutex_lock(m->mutex);
- pa_mainloop_run(m->real_mainloop, NULL);
+ (void) pa_mainloop_run(m->real_mainloop, NULL);
pa_mutex_unlock(m->mutex);
}
commit fa7329a2ddc8bbc4e996365ee8d3426e20c9fd5c
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Tue Mar 7 21:41:56 2017 +0100
oss: Fix dead code
mode cannot be 0
Coverity ID: #1137964
Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
diff --git a/src/modules/oss/module-oss.c b/src/modules/oss/module-oss.c
index 8a5a692..5ad765d 100644
--- a/src/modules/oss/module-oss.c
+++ b/src/modules/oss/module-oss.c
@@ -1195,7 +1195,7 @@ int pa__init(pa_module*m) {
goto fail;
}
- mode = (playback && record) ? O_RDWR : (playback ? O_WRONLY : (record ? O_RDONLY : 0));
+ mode = (playback && record) ? O_RDWR : (playback ? O_WRONLY : O_RDONLY);
ss = m->core->default_sample_spec;
map = m->core->default_channel_map;
commit eab0b9d83bccf470fd0b392e358f7bcd63420c77
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Tue Mar 7 16:09:56 2017 +0100
core: Ignore pa_shared_remove() return value
document behaviour of pa_shared_remove() in case name does not exist
Coverity ID: #1380672
thanks to Georg Chini for suggesting to swap patch title and commit message
Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
diff --git a/src/pulsecore/shared.c b/src/pulsecore/shared.c
index 1b5eea9..9bc7eb5 100644
--- a/src/pulsecore/shared.c
+++ b/src/pulsecore/shared.c
@@ -111,6 +111,6 @@ int pa_shared_replace(pa_core *c, const char *name, void *data) {
pa_assert(c);
pa_assert(name);
- pa_shared_remove(c, name);
+ (void) pa_shared_remove(c, name);
return pa_shared_set(c, name, data);
}
diff --git a/src/pulsecore/shared.h b/src/pulsecore/shared.h
index 49e8738..19ac462 100644
--- a/src/pulsecore/shared.h
+++ b/src/pulsecore/shared.h
@@ -44,7 +44,9 @@ int pa_shared_set(pa_core *c, const char *name, void *data);
/* Remove the specified shared property. Return non-zero on failure */
int pa_shared_remove(pa_core *c, const char *name);
-/* A combination of pa_shared_remove() and pa_shared_set() */
+/* A combination of pa_shared_remove() and pa_shared_set(); this function
+ * first tries to remove the property by this name and then sets the
+ * property. Return non-zero on failure. */
int pa_shared_replace(pa_core *c, const char *name, void *data);
/* Dump the current set of shared properties */
commit 976f7e9a61e026de9d976a7e35b13cdd0314b0a1
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Tue Mar 7 15:57:28 2017 +0100
core: Assert return value of pa_shared_set/_remove() in dbus-shared
it must succeed, or we are leaking memory
Coverity ID: #1380674, #1380673
Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
diff --git a/src/pulsecore/dbus-shared.c b/src/pulsecore/dbus-shared.c
index 935b068..3422c29 100644
--- a/src/pulsecore/dbus-shared.c
+++ b/src/pulsecore/dbus-shared.c
@@ -45,7 +45,7 @@ static pa_dbus_connection* dbus_connection_new(pa_core *c, pa_dbus_wrap_connecti
pconn->property_name = name;
pconn->connection = conn;
- pa_shared_set(c, name, pconn);
+ pa_assert_se(pa_shared_set(c, name, pconn) >= 0);
return pconn;
}
@@ -88,7 +88,7 @@ void pa_dbus_connection_unref(pa_dbus_connection *c) {
pa_dbus_wrap_connection_free(c->connection);
- pa_shared_remove(c->core, c->property_name);
+ pa_assert_se(pa_shared_remove(c->core, c->property_name) >= 0);
pa_xfree(c);
}
More information about the pulseaudio-commits
mailing list