Mesa (radeon-rewrite): r300: fix valgrind warnings

Alex Deucher agd5f at kemper.freedesktop.org
Mon Apr 27 11:44:13 PDT 2009


Module: Mesa
Branch: radeon-rewrite
Commit: 3d83a709b94e72608a061449bc30edc8af7c9ecc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d83a709b94e72608a061449bc30edc8af7c9ecc

Author: Maciej Cencora <m.cencora at gmail.com>
Date:   Sat Apr 25 13:50:49 2009 +0200

r300: fix valgrind warnings

---

 src/mesa/drivers/dri/radeon/radeon_common.c |    2 +-
 src/mesa/drivers/dri/radeon/radeon_screen.c |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c
index 312c2a7..8b5b892 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common.c
@@ -1186,7 +1186,7 @@ void rcommonInitCmdBuf(radeonContextPtr rmesa)
 		radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_VRAM, rmesa->radeonScreen->texSize[0]);
 		radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_GTT, rmesa->radeonScreen->gartTextures.size);
 	} else {
-		struct drm_radeon_gem_info mminfo;
+		struct drm_radeon_gem_info mminfo = { 0 };
 
 		if (!drmCommandWriteRead(rmesa->dri.fd, DRM_RADEON_GEM_INFO, &mminfo, sizeof(mminfo)))
 		{
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index e24be0c..1541412 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -249,8 +249,8 @@ static int
 radeonGetParam(__DRIscreenPrivate *sPriv, int param, void *value)
 {
   int ret;
-  drm_radeon_getparam_t gp;
-  struct drm_radeon_info info;
+  drm_radeon_getparam_t gp = { 0 };
+  struct drm_radeon_info info = { 0 };
 
   if (sPriv->drm_version.major >= 2) {
       info.value = (uint64_t)value;
@@ -869,7 +869,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
        __driUtilMessage("%s: drmMapBufs failed\n", __FUNCTION__ );
        return NULL;
      }
-     
+
      if ( dri_priv->gartTexHandle && dri_priv->gartTexMapSize ) {
        screen->gartTextures.handle = dri_priv->gartTexHandle;
        screen->gartTextures.size   = dri_priv->gartTexMapSize;
@@ -884,7 +884,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
 	 __driUtilMessage("%s: drmMap failed for GART texture area\n", __FUNCTION__);
 	 return NULL;
        }
-       
+
        screen->gart_texture_offset = dri_priv->gartTexOffset + screen->gart_base;
      }
    }
@@ -1064,7 +1064,7 @@ radeonCreateScreen2(__DRIscreenPrivate *sPriv)
    radeonScreenPtr screen;
    int i;
    int ret;
-   uint32_t device_id;
+   uint32_t device_id = 0;
    uint32_t temp = 0;
 
    /* Allocate the private area */



More information about the mesa-commit mailing list