Re: [Intel-gfx] [PATCH] drm/i915: Fix an error handling path in igt_write_huge()

From: Andi Shyti
Date: Mon Jul 24 2023 - 12:24:38 EST


Hi Christophe,

On Mon, Jul 17, 2023 at 08:49:31PM +0200, Christophe JAILLET wrote:
> All error handling paths go to 'out', except this one. Be consistent and
> also branch to 'out' here.
>
> Fixes: c10a652e239e ("drm/i915/selftests: Rework context handling in hugepages selftests")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> ---
> /!\ Speculative /!\
>
> This patch is based on analysis of the surrounding code and should be
> reviewed with care !
>
> If the patch is wrong, maybe a comment in the code could explain why.
>
> /!\ Speculative /!\
> ---
> drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> index df6c9a84252c..6b9f6cf50bf6 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> @@ -1246,8 +1246,10 @@ static int igt_write_huge(struct drm_i915_private *i915,
> * times in succession a possibility by enlarging the permutation array.
> */
> order = i915_random_order(count * count, &prng);
> - if (!order)
> - return -ENOMEM;
> + if (!order) {
> + err = -ENOMEM;
> + goto out;
> + }

Looks good:

Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxxxxxxx>

Thanks,
Andi