xserver: Branch 'master' - 7 commits

Keith Packard keithp at kemper.freedesktop.org
Mon May 6 10:53:23 PDT 2013


 glx/glxdri.c                     |    8 ++++++--
 glx/glxdri2.c                    |    2 +-
 hw/dmx/config/dmxcompat.c        |    4 ++++
 hw/xfree86/common/xf86Events.c   |    2 ++
 hw/xfree86/common/xf86sbusBus.c  |    6 ++++--
 hw/xfree86/os-support/bus/Sbus.c |    8 ++++++--
 6 files changed, 23 insertions(+), 7 deletions(-)

New commits:
commit 2746c681639f9512e6e45fb8d0151b996b6aff7f
Merge: 1e6cf8e 9878e09
Author: Keith Packard <keithp at keithp.com>
Date:   Mon May 6 10:52:40 2013 -0700

    Merge remote-tracking branch 'alanc/master'

commit 9878e097a7de2f86eff0dcfd9fe5d83b162197ec
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Wed Apr 24 15:24:31 2013 -0700

    Only call xf86platformVTProbe() when it's defined
    
    Fixes build on non-udev systems, since XSERVER_PLATFORM_BUS is only
    defined in configure.ac if $CONFIG_UDEV_KMS is true.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index ea18420..7a949fd 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -561,8 +561,10 @@ xf86VTSwitch(void)
         for (ih = InputHandlers; ih; ih = ih->next)
             xf86EnableInputHandler(ih);
 
+#ifdef XSERVER_PLATFORM_BUS
         /* check for any new output devices */
         xf86platformVTProbe();
+#endif
 
         OsReleaseSIGIO();
     }
commit 2b361fbda536f0125e4b87a6d455acc58f4e8690
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Feb 10 10:24:59 2013 -0800

    sparcPromPathname2Node: free name when returning error, instead of leaking it
    
    Reported with other leaks found by cppcheck in bugzilla #50281
    https://bugs.freedesktop.org/show_bug.cgi?id=50281
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c
index 8260007..14e6d4b 100644
--- a/hw/xfree86/os-support/bus/Sbus.c
+++ b/hw/xfree86/os-support/bus/Sbus.c
@@ -617,8 +617,10 @@ sparcPromPathname2Node(const char *pathName)
         return 0;
     strcpy(name, pathName);
     name[i + 1] = 0;
-    if (name[0] != '/')
+    if (name[0] != '/') {
+        free(name);
         return 0;
+    }
     p = strchr(name + 1, '/');
     if (p)
         *p = 0;
@@ -629,8 +631,10 @@ sparcPromPathname2Node(const char *pathName)
         *regstr++ = 0;
     else
         regstr = p;
-    if (name + 1 == regstr)
+    if (name + 1 == regstr) {
+        free(name);
         return 0;
+    }
     promGetSibling(0);
     i = promWalkPathname2Node(name + 1, regstr, promRootNode, 0);
     free(name);
commit 174ccd84931ece5a92a09c4a1d6a47e0958ebf7e
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Feb 10 10:24:59 2013 -0800

    xf86SbusCmapLoadPalette: Delay malloc until needed, avoiding leak on error
    
    Reported with other leaks found by cppcheck in bugzilla #50281
    https://bugs.freedesktop.org/show_bug.cgi?id=50281
    
    V2: check for malloc failure
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
index b6a6b94..07eb71e 100644
--- a/hw/xfree86/common/xf86sbusBus.c
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -641,14 +641,16 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
     int i, index;
     sbusCmapPtr cmap;
     struct fbcmap fbcmap;
-    unsigned char *data = malloc(numColors * 3);
+    unsigned char *data;
 
     cmap = SBUSCMAPPTR(pScrn->pScreen);
     if (!cmap)
         return;
     fbcmap.count = 0;
     fbcmap.index = indices[0];
-    fbcmap.red = data;
+    fbcmap.red = data = malloc(numColors * 3);
+    if (!data)
+        return;
     fbcmap.green = data + numColors;
     fbcmap.blue = fbcmap.green + numColors;
     for (i = 0; i < numColors; i++) {
commit 6bca0184d167388cd417d113031317990489987d
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Feb 10 10:18:02 2013 -0800

    dmxVDLRead: if we opened a file, close it instead of leaking it
    
    Reported with other leaks found by cppcheck in bugzilla #50281
    https://bugs.freedesktop.org/show_bug.cgi?id=50281
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/dmx/config/dmxcompat.c b/hw/dmx/config/dmxcompat.c
index bd9f127..107991a 100644
--- a/hw/dmx/config/dmxcompat.c
+++ b/hw/dmx/config/dmxcompat.c
@@ -228,5 +228,9 @@ dmxVDLRead(const char *filename)
             break;
         }
     }
+
+    if (str != stdin)
+        fclose(str);
+
     return entry;
 }
commit 8c5ff2e93f73b24adff741b25fc1e31b2f5dd0ac
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Feb 10 10:24:59 2013 -0800

    __glXDRIscreenProbe: free screen when DRI2Connect fails, instead of leaking it
    
    Reported with other leaks found by cppcheck in bugzilla #50281
    https://bugs.freedesktop.org/show_bug.cgi?id=50281
    
    V2: goto existing error handler, instead of replicating more of it here
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index e07cb56..6548579 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -946,7 +946,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
                      &screen->fd, &driverName, &deviceName)) {
         LogMessage(X_INFO,
                    "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
-        return NULL;
+        goto handle_error;
     }
 
     screen->base.destroy = __glXDRIscreenDestroy;
commit 9567fa9a7269765bc59ac71b931e16df261d794d
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Feb 10 10:24:59 2013 -0800

    __glXDRIscreenCreateContext: free context on failure, instead of leaking it
    
    Reported with other leaks found by cppcheck in bugzilla #50281
    https://bugs.freedesktop.org/show_bug.cgi?id=50281
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

diff --git a/glx/glxdri.c b/glx/glxdri.c
index a997e2f..1964d2e 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -645,8 +645,10 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
     for (i = 0; i < pScreen->numVisuals; i++, visual++)
         if (visual->vid == glxConfig->visualID)
             break;
-    if (i == pScreen->numVisuals)
+    if (i == pScreen->numVisuals) {
+        free(context);
         return NULL;
+    }
 
     context->hwContextID = FakeClientID(0);
 
@@ -655,8 +657,10 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
                               context->hwContextID, &hwContext);
     __glXleaveServer(GL_FALSE);
 
-    if (!retval)
+    if (!retval) {
+        free(context);
         return NULL;
+    }
 
     context->driContext = screen->legacy->createNewContext(screen->driScreen, config->driConfig, 0,     /* render type */
                                                            driShare,


More information about the xorg-commit mailing list