[PATCH] dma-buf: fix uninitialized variable usage in selftests

Alex Deucher alexdeucher at gmail.com
Mon Oct 25 15:59:06 UTC 2021


On Mon, Oct 25, 2021 at 3:28 AM Christian König
<ckoenig.leichtzumerken at gmail.com> wrote:
>
> "i" can be used uninitialized in one of the error branches. Fix this.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> Reported-by: kernel test robot <lkp at intel.com>

Acked-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/dma-buf/st-dma-resv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma-buf/st-dma-resv.c b/drivers/dma-buf/st-dma-resv.c
> index 6f3ba756da3e..bc2265807f6c 100644
> --- a/drivers/dma-buf/st-dma-resv.c
> +++ b/drivers/dma-buf/st-dma-resv.c
> @@ -295,7 +295,7 @@ static int test_get_fences(void *arg, bool shared)
>                 if (r) {
>                         pr_err("Resv shared slot allocation failed\n");
>                         dma_resv_unlock(&resv);
> -                       goto err_free;
> +                       goto err_fini;
>                 }
>
>                 dma_resv_add_shared_fence(&resv, f);
> @@ -336,6 +336,7 @@ static int test_get_fences(void *arg, bool shared)
>         while (i--)
>                 dma_fence_put(fences[i]);
>         kfree(fences);
> +err_fini:
>         dma_resv_fini(&resv);
>         dma_fence_put(f);
>         return r;
> --
> 2.25.1
>


More information about the dri-devel mailing list