[mesa,v2] clover: Fix pipe_grid_info.indirect not being initialized

Submitted by Hans de Goede on March 14, 2016, 2:01 p.m.

Details

Message ID 1457964065-3137-1-git-send-email-hdegoede@redhat.com
State New
Headers show
Series "clover: Fix pipe_grid_info.indirect not being initialized" ( rev: 3 ) in Nouveau

Not browsing as part of any series.

Commit Message

Hans de Goede March 14, 2016, 2:01 p.m.
After pipe_grid_info.indirect was introduced, clover was not modified
to set it causing it to pass uninitialized memory for it to launch_grid.

This commit fixes this by zero-ing the entire pipe_grid_info struct when
declaring it, to avoid similar problems popping-up in the future.

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Drop trailing "," from struct initializer
-Add Cc: "11.2" <mesa-stable@lists.freedesktop.org>
---
 src/gallium/state_trackers/clover/core/kernel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
index 8396be9..1ab87ec 100644
--- a/src/gallium/state_trackers/clover/core/kernel.cpp
+++ b/src/gallium/state_trackers/clover/core/kernel.cpp
@@ -55,7 +55,7 @@  kernel::launch(command_queue &q,
    const auto reduced_grid_size =
       map(divides(), grid_size, block_size);
    void *st = exec.bind(&q, grid_offset);
-   struct pipe_grid_info info;
+   struct pipe_grid_info info = { 0 };
 
    // The handles are created during exec_context::bind(), so we need make
    // sure to call exec_context::bind() before retrieving them.

Comments

Thanks Hans!

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>

On 03/14/2016 03:01 PM, Hans de Goede wrote:
> After pipe_grid_info.indirect was introduced, clover was not modified
> to set it causing it to pass uninitialized memory for it to launch_grid.
>
> This commit fixes this by zero-ing the entire pipe_grid_info struct when
> declaring it, to avoid similar problems popping-up in the future.
>
> Cc: "11.2" <mesa-stable@lists.freedesktop.org>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> -Drop trailing "," from struct initializer
> -Add Cc: "11.2" <mesa-stable@lists.freedesktop.org>
> ---
>   src/gallium/state_trackers/clover/core/kernel.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
> index 8396be9..1ab87ec 100644
> --- a/src/gallium/state_trackers/clover/core/kernel.cpp
> +++ b/src/gallium/state_trackers/clover/core/kernel.cpp
> @@ -55,7 +55,7 @@ kernel::launch(command_queue &q,
>      const auto reduced_grid_size =
>         map(divides(), grid_size, block_size);
>      void *st = exec.bind(&q, grid_offset);
> -   struct pipe_grid_info info;
> +   struct pipe_grid_info info = { 0 };
>
>      // The handles are created during exec_context::bind(), so we need make
>      // sure to call exec_context::bind() before retrieving them.
>