[pulseaudio-commits] 2 commits - src/modules src/utils

Peter Meerwald pmeerw at kemper.freedesktop.org
Tue Jul 21 07:46:56 PDT 2015


 src/modules/xen/module-xenpv-sink.c |    7 ++++---
 src/utils/padsp.c                   |    3 +++
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 8b3b39c7d832f8fdf11798fc04061ba353393f70
Author: Deepak Srivastava <srivastava.d at samsung.com>
Date:   Thu Jul 2 10:45:09 2015 +0530

    padsp: Avoid possible deadlock. Unlocked i->mainloop before returning from default case.
    
    BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=91184
    
    Signed-off-by: Deepak Srivastava <srivastava.d at samsung.com>
    Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>

diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index b696b39..5e336bb 100644
--- a/src/utils/padsp.c
+++ b/src/utils/padsp.c
@@ -1201,6 +1201,9 @@ static int dsp_open(int flags, int *_errno) {
         i->io_flags = PA_IO_EVENT_INPUT | PA_IO_EVENT_OUTPUT;
         break;
     default:
+        pa_threaded_mainloop_unlock(i->mainloop);
+        fd_info_unref(i);
+        *_errno = EIO;
         return -1;
     }
 

commit dd084acb2834f1b6bb92c304f70e0ed0c0be84f6
Author: Manish Sogi <manish.sogi at samsung.com>
Date:   Thu Jul 2 09:54:19 2015 +0530

    xen: Resource leak in local function alloc_gref() - alloc_fd and dev_fd
    
    The file descriptors need to be closed in failure cases otherwise resource
    leak is there.
    
    Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=91174#c0
    
    Signed-off-by: Manish Sogi <manish.sogi at samsung.com>

diff --git a/src/modules/xen/module-xenpv-sink.c b/src/modules/xen/module-xenpv-sink.c
index b87f811..4813f10 100644
--- a/src/modules/xen/module-xenpv-sink.c
+++ b/src/modules/xen/module-xenpv-sink.c
@@ -591,6 +591,7 @@ static int alloc_gref(struct ioctl_gntalloc_alloc_gref *gref_, void **addr) {
     dev_fd = open("/dev/xen/gntdev", O_RDWR);
     if (dev_fd<=0) {
         perror("Could not open /dev/xen/gntdev! Have you loaded the xen_gntdev module?");
+        close(alloc_fd);
         return 1;
     }
 
@@ -602,7 +603,7 @@ static int alloc_gref(struct ioctl_gntalloc_alloc_gref *gref_, void **addr) {
     rv = ioctl(alloc_fd, IOCTL_GNTALLOC_ALLOC_GREF, gref_);
     if (rv) {
         pa_log_debug("Xen audio sink: src-add error: %s (rv=%d)\n", strerror(errno), rv);
-        return rv;
+        goto finish;
     }
 
     /*addr=NULL(default),length, prot,             flags,    fd,         offset*/
@@ -610,7 +611,7 @@ static int alloc_gref(struct ioctl_gntalloc_alloc_gref *gref_, void **addr) {
     if (*addr == MAP_FAILED) {
         *addr = 0;
         pa_log_debug("Xen audio sink: mmap'ing shared page failed\n");
-        return rv;
+        goto finish;
     }
 
     pa_log_debug("Xen audio sink: Got grant #%d. Mapped locally at %Ld=%p\n",
@@ -626,7 +627,7 @@ static int alloc_gref(struct ioctl_gntalloc_alloc_gref *gref_, void **addr) {
        if (rv)
        pa_log_debug("gntalloc unmap notify error: %s (rv=%d)\n", strerror(errno), rv);
        */
-
+finish:
     close(alloc_fd);
     close(dev_fd);
 



More information about the pulseaudio-commits mailing list