[Mesa-dev] [PATCH 12/17] radv: Fix compiler warning about uninitialized 'set'
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Sun Feb 11 14:41:59 UTC 2018
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
On Sat, Feb 10, 2018 at 5:33 PM, Eric Anholt <eric at anholt.net> wrote:
> The compiler doesn't figure out that we only get result == VK_SUCCESS if
> set got initialized.
>
> Cc: Dave Airlie <airlied at redhat.com>
> ---
> src/amd/vulkan/radv_descriptor_set.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
> index bbabfa9b2755..056a5644dfa0 100644
> --- a/src/amd/vulkan/radv_descriptor_set.c
> +++ b/src/amd/vulkan/radv_descriptor_set.c
> @@ -518,7 +518,7 @@ VkResult radv_AllocateDescriptorSets(
>
> VkResult result = VK_SUCCESS;
> uint32_t i;
> - struct radv_descriptor_set *set;
> + struct radv_descriptor_set *set = NULL;
>
> /* allocate a set of buffers for each shader to contain descriptors */
> for (i = 0; i < pAllocateInfo->descriptorSetCount; i++) {
> --
> 2.15.0
>
> _______________________________________________
> 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