Mesa (master): id, glhd: Fix segfault with misreferenced pipe member.

Corbin Simpson csimpson at kemper.freedesktop.org
Wed Jun 23 00:12:50 PDT 2010


Module: Mesa
Branch: master
Commit: 75612aa19946c6e546ff72b83d0e1bbe4db90db2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=75612aa19946c6e546ff72b83d0e1bbe4db90db2

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Tue Jun 22 22:13:33 2010 -0700

id, glhd: Fix segfault with misreferenced pipe member.

And remove the offending member to keep that from happening again.

---

 src/gallium/drivers/galahad/glhd_objects.c |    4 ++--
 src/gallium/drivers/galahad/glhd_objects.h |    1 -
 src/gallium/drivers/identity/id_objects.c  |    4 ++--
 src/gallium/drivers/identity/id_objects.h  |    1 -
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_objects.c b/src/gallium/drivers/galahad/glhd_objects.c
index cea32d7..4682d71 100644
--- a/src/gallium/drivers/galahad/glhd_objects.c
+++ b/src/gallium/drivers/galahad/glhd_objects.c
@@ -180,7 +180,7 @@ galahad_transfer_destroy(struct galahad_context *glhd_context,
                           struct galahad_transfer *glhd_transfer)
 {
    pipe_resource_reference(&glhd_transfer->base.resource, NULL);
-   glhd_transfer->pipe->transfer_destroy(glhd_context->pipe,
-                                       glhd_transfer->transfer);
+   glhd_context->pipe->transfer_destroy(glhd_context->pipe,
+                                        glhd_transfer->transfer);
    FREE(glhd_transfer);
 }
diff --git a/src/gallium/drivers/galahad/glhd_objects.h b/src/gallium/drivers/galahad/glhd_objects.h
index 16e1d94..9358039 100644
--- a/src/gallium/drivers/galahad/glhd_objects.h
+++ b/src/gallium/drivers/galahad/glhd_objects.h
@@ -65,7 +65,6 @@ struct galahad_transfer
 {
    struct pipe_transfer base;
 
-   struct pipe_context *pipe;
    struct pipe_transfer *transfer;
 };
 
diff --git a/src/gallium/drivers/identity/id_objects.c b/src/gallium/drivers/identity/id_objects.c
index ca4743f..82d06e7 100644
--- a/src/gallium/drivers/identity/id_objects.c
+++ b/src/gallium/drivers/identity/id_objects.c
@@ -180,8 +180,8 @@ identity_transfer_destroy(struct identity_context *id_context,
                           struct identity_transfer *id_transfer)
 {
    pipe_resource_reference(&id_transfer->base.resource, NULL);
-   id_transfer->pipe->transfer_destroy(id_context->pipe,
-                                       id_transfer->transfer);
+   id_context->pipe->transfer_destroy(id_context->pipe,
+                                      id_transfer->transfer);
    FREE(id_transfer);
 }
 
diff --git a/src/gallium/drivers/identity/id_objects.h b/src/gallium/drivers/identity/id_objects.h
index 5eea10b..e8deabf 100644
--- a/src/gallium/drivers/identity/id_objects.h
+++ b/src/gallium/drivers/identity/id_objects.h
@@ -65,7 +65,6 @@ struct identity_transfer
 {
    struct pipe_transfer base;
 
-   struct pipe_context *pipe;
    struct pipe_transfer *transfer;
 };
 



More information about the mesa-commit mailing list