st/xorg: fix use-after-free
authornobled <nobled@dreamwidth.org>
Sat, 24 Jul 2010 12:05:30 +0000 (12:05 +0000)
committerJakob Bornecrantz <jakob@vmware.com>
Mon, 26 Jul 2010 19:26:58 +0000 (12:26 -0700)
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
src/gallium/state_trackers/xorg/xorg_driver.c

index e993ccc9bf0cb8164302c17c39eb1a2936cfe30d..e10ff2f95087053eb075ff222178d2178a8c90bc 100644 (file)
@@ -472,7 +472,6 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
            max_height = max < max_height ? max : max_height;
        }
 
-       drmModeFreeResources(res);
        xf86CrtcSetSizeRange(pScrn, res->min_width,
                             res->min_height, max_width, max_height);
        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
@@ -481,6 +480,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                   "Min height %d, Max Height %d.\n",
                   res->min_height, max_height);
+       drmModeFreeResources(res);
     }