[Mesa-dev] [PATCH 1/2] radv: move assert down in radv_bind_descriptor_set

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Tue Jun 13 00:01:14 UTC 2017


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Tue, Jun 13, 2017 at 1:53 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> coverity complains about the deref before NULL check.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/amd/vulkan/radv_cmd_buffer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
> index b08f218..9f36d98 100644
> --- a/src/amd/vulkan/radv_cmd_buffer.c
> +++ b/src/amd/vulkan/radv_cmd_buffer.c
> @@ -2015,13 +2015,13 @@ void radv_bind_descriptor_set(struct radv_cmd_buffer *cmd_buffer,
>  {
>         struct radeon_winsys *ws = cmd_buffer->device->ws;
>
> -       assert(!(set->layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR));
> -
>         cmd_buffer->state.descriptors[idx] = set;
>         cmd_buffer->state.descriptors_dirty |= (1u << idx);
>         if (!set)
>                 return;
>
> +       assert(!(set->layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR));
> +
>         for (unsigned j = 0; j < set->layout->buffer_count; ++j)
>                 if (set->descriptors[j])
>                         ws->cs_add_buffer(cmd_buffer->cs, set->descriptors[j], 7);
> --
> 2.9.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list