xserver: Branch 'server-1.12-branch' - 3 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed Aug 1 17:50:27 PDT 2012


 dix/touch.c                 |    4 +++-
 hw/xfree86/loader/loader.c  |    6 ++++++
 hw/xfree86/loader/loader.h  |    1 +
 hw/xfree86/loader/loadmod.c |    2 +-
 xkb/xkbAccessX.c            |   10 +++++-----
 5 files changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 7197c1c571dab1ecef2dc57b8e3bd2689b589f6d
Author: Michal Srb <msrb at suse.com>
Date:   Thu Jun 28 17:17:12 2012 +0200

    Look for ModuleData only in appropriate library
    
    LoaderSymbol calls dlsym with RTLD_DEFAULT pseudo handle making it search in
    every loaded library. In addition glibc adds NODELETE flag to the library
    containing the symbol.
    
    It's used in doLoadModule to locate <modulename>ModuleData symbol, the
    module's library gets the flag and is kept in memory even after it is
    unloaded.
    
    This patch adds LoaderSymbolFromModule function that looks for symbol only in
    library specified by handle. That way the NODELETE flag isn't added.
    
    This glibc behavior doesn't seem to be documented, but even if other
    implementations differ, there is no reason to search ModuleData symbol outside
    the module's library.
    
    Signed-off-by: Michal Srb <msrb at suse.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    
    v2: Switch LoaderSymbolFromModule arguments order.
        Correct description.
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 258abbf823f753757e4dddc13ef495f4024680db)

diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index b72b8b8..4836964 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -160,6 +160,12 @@ LoaderSymbol(const char *name)
     return NULL;
 }
 
+void *
+LoaderSymbolFromModule(void *handle, const char *name)
+{
+    return dlsym(handle, name);
+}
+
 void
 LoaderUnload(const char *name, void *handle)
 {
diff --git a/hw/xfree86/loader/loader.h b/hw/xfree86/loader/loader.h
index 5cadd5a..c89c641 100644
--- a/hw/xfree86/loader/loader.h
+++ b/hw/xfree86/loader/loader.h
@@ -72,5 +72,6 @@ extern unsigned long LoaderOptions;
 
 /* Internal Functions */
 void *LoaderOpen(const char *, int *, int *);
+void *LoaderSymbolFromModule(void *, const char *);
 
 #endif                          /* _LOADER_H */
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index c6b5590..6fa9554 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -938,7 +938,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
             *errmin = 0;
         goto LoadModule_fail;
     }
-    initdata = LoaderSymbol(p);
+    initdata = LoaderSymbolFromModule(ret->handle, p);
     if (initdata) {
         ModuleSetupProc setup;
         ModuleTearDownProc teardown;
commit b0e3696e01ec69e17b74164f4b366baef316f86c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jun 25 14:22:31 2012 +1000

    dix: fix dereference before null check
    
    Found by Coverity.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    (cherry picked from commit 55ff20eb37f00a3ad07b5acff19d4497ab513a97)

diff --git a/dix/touch.c b/dix/touch.c
index 04733ab..ad48d8a 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -160,11 +160,13 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id)
     int i;
     TouchClassPtr t = dev->touch;
     DDXTouchPointInfoPtr ti = NULL;
-    Bool emulate_pointer = (t->mode == XIDirectTouch);
+    Bool emulate_pointer;
 
     if (!t)
         return NULL;
 
+    emulate_pointer = (t->mode == XIDirectTouch);
+
     /* Look for another active touchpoint with the same DDX ID. DDX
      * touchpoints must be unique. */
     if (TouchFindByDDXID(dev, ddx_id, FALSE))
commit b99a4ac32cc613337af79eb130247364f478dd21
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jun 20 14:25:54 2012 +1000

    xkb: use local variable instead of casting arg
    
    No functional changes.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 252a69b592001b34714d0fe7508e1898883f9d01)

diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 765772b..e19ef30 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -281,12 +281,12 @@ AccessXStickyKeysTurnOff(DeviceIntPtr dev, xkbControlsNotify * pCN)
 static CARD32
 AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
 {
-    XkbSrvInfoPtr xkbi = ((DeviceIntPtr) arg)->key->xkbInfo;
     xkbControlsNotify cn;
+    DeviceIntPtr dev = arg;
+    XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
 
     if (xkbi->krgTimerActive == _KRG_WARN_TIMER) {
-        XkbDDXAccessXBeep((DeviceIntPtr) arg, _BEEP_SLOW_WARN,
-                          XkbStickyKeysMask);
+        XkbDDXAccessXBeep(dev, _BEEP_SLOW_WARN, XkbStickyKeysMask);
         xkbi->krgTimerActive = _KRG_TIMER;
         return 4000;
     }
@@ -296,11 +296,11 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
     cn.requestMajor = 0;
     cn.requestMinor = 0;
     if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) {
-        AccessXKRGTurnOff((DeviceIntPtr) arg, &cn);
+        AccessXKRGTurnOff(dev, &cn);
         LogMessage(X_INFO, "XKB SlowKeys are disabled.\n");
     }
     else {
-        AccessXKRGTurnOn((DeviceIntPtr) arg, XkbSlowKeysMask, &cn);
+        AccessXKRGTurnOn(dev, XkbSlowKeysMask, &cn);
         LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n");
     }
 


More information about the xorg-commit mailing list