From 1c42668e9eac0e36c6aee72291ca6d358e01a4e5 Mon Sep 17 00:00:00 2001
From: Michel Hermier <hermier@frugalware.org>
Date: Fri, 17 Dec 2010 13:25:48 +0100
Subject: [PATCH] nouveau: initialise kernel request structures

---
 nouveau/nouveau_bo.c      |   14 +++++++-------
 nouveau/nouveau_device.c  |    4 ++--
 nouveau/nouveau_pushbuf.c |    4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/nouveau/nouveau_bo.c b/nouveau/nouveau_bo.c
index d6bb22d..e6e3e98 100644
--- a/nouveau/nouveau_bo.c
+++ b/nouveau/nouveau_bo.c
@@ -94,7 +94,7 @@ static void
 nouveau_bo_kfree(struct nouveau_bo_priv *nvbo)
 {
 	struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device);
-	struct drm_gem_close req;
+	struct drm_gem_close req = { 0 };
 
 	if (!nvbo->handle)
 		return;
@@ -113,7 +113,7 @@ static int
 nouveau_bo_kalloc(struct nouveau_bo_priv *nvbo, struct nouveau_channel *chan)
 {
 	struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device);
-	struct drm_nouveau_gem_new req;
+	struct drm_nouveau_gem_new req = { 0 };
 	struct drm_nouveau_gem_info *info = &req.info;
 	int ret;
 
@@ -241,7 +241,7 @@ nouveau_bo_wrap(struct nouveau_device *dev, uint32_t handle,
 		struct nouveau_bo **bo)
 {
 	struct nouveau_device_priv *nvdev = nouveau_device(dev);
-	struct drm_nouveau_gem_info req;
+	struct drm_nouveau_gem_info req = { 0 };
 	struct nouveau_bo_priv *nvbo;
 	int ret;
 
@@ -274,7 +274,7 @@ nouveau_bo_handle_get(struct nouveau_bo *bo, uint32_t *handle)
 		return -EINVAL;
 
 	if (!nvbo->global_handle) {
-		struct drm_gem_flink req;
+		struct drm_gem_flink req = { 0 };
  
 		ret = nouveau_bo_kalloc(nvbo, NULL);
 		if (ret)
@@ -300,7 +300,7 @@ nouveau_bo_handle_ref(struct nouveau_device *dev, uint32_t handle,
 {
 	struct nouveau_device_priv *nvdev = nouveau_device(dev);
 	struct nouveau_bo_priv *nvbo;
-	struct drm_gem_open req;
+	struct drm_gem_open req = { 0 };
 	int ret;
 
 	req.name = handle;
@@ -365,7 +365,7 @@ nouveau_bo_wait(struct nouveau_bo *bo, int cpu_write, int no_wait, int no_block)
 {
 	struct nouveau_device_priv *nvdev = nouveau_device(bo->device);
 	struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
-	struct drm_nouveau_gem_cpu_prep req;
+	struct drm_nouveau_gem_cpu_prep req = { 0 };
 	int ret;
 
 	if (!nvbo->global_handle && !nvbo->write_marker && !cpu_write)
@@ -462,7 +462,7 @@ nouveau_bo_unmap(struct nouveau_bo *bo)
 
 	if (bo->map && !nvbo->sysmem && nvbo->map_refcnt) {
 		struct nouveau_device_priv *nvdev = nouveau_device(bo->device);
-		struct drm_nouveau_gem_cpu_fini req;
+		struct drm_nouveau_gem_cpu_fini req = { 0 };
 
 		req.handle = nvbo->handle;
 		drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GEM_CPU_FINI,
diff --git a/nouveau/nouveau_device.c b/nouveau/nouveau_device.c
index 2ffcba6..ad4f78d 100644
--- a/nouveau/nouveau_device.c
+++ b/nouveau/nouveau_device.c
@@ -157,7 +157,7 @@ nouveau_device_get_param(struct nouveau_device *dev,
 			 uint64_t param, uint64_t *value)
 {
 	struct nouveau_device_priv *nvdev = nouveau_device(dev);
-	struct drm_nouveau_getparam g;
+	struct drm_nouveau_getparam g = { 0 };
 	int ret;
 
 	if (!nvdev || !value)
@@ -178,7 +178,7 @@ nouveau_device_set_param(struct nouveau_device *dev,
 			 uint64_t param, uint64_t value)
 {
 	struct nouveau_device_priv *nvdev = nouveau_device(dev);
-	struct drm_nouveau_setparam s;
+	struct drm_nouveau_setparam s = { 0 };
 	int ret;
 
 	if (!nvdev)
diff --git a/nouveau/nouveau_pushbuf.c b/nouveau/nouveau_pushbuf.c
index 90836bc..bcf3cae 100644
--- a/nouveau/nouveau_pushbuf.c
+++ b/nouveau/nouveau_pushbuf.c
@@ -80,7 +80,7 @@ nouveau_pushbuf_fini_call(struct nouveau_channel *chan)
 static int
 nouveau_pushbuf_init_call(struct nouveau_channel *chan, int buf_size)
 {
-	struct drm_nouveau_gem_pushbuf req;
+	struct drm_nouveau_gem_pushbuf req = { 0 };
 	struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
 	struct nouveau_pushbuf_priv *nvpb = &nvchan->pb;
 	struct nouveau_device *dev = chan->device;
@@ -224,7 +224,7 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
 	struct nouveau_device_priv *nvdev = nouveau_device(chan->device);
 	struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
 	struct nouveau_pushbuf_priv *nvpb = &nvchan->pb;
-	struct drm_nouveau_gem_pushbuf req;
+	struct drm_nouveau_gem_pushbuf req = { 0 };
 	unsigned i;
 	int ret;
 
-- 
1.7.3.3

