From patchwork Mon Jul 17 18:49:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13316294 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A57F6EB64DC for ; Mon, 17 Jul 2023 18:57:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E7AD10E2A6; Mon, 17 Jul 2023 18:57:11 +0000 (UTC) X-Greylist: delayed 450 seconds by postgrey-1.36 at gabe; Mon, 17 Jul 2023 18:57:08 UTC Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C18610E2A6 for ; Mon, 17 Jul 2023 18:57:08 +0000 (UTC) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id LTHoqBKeeFmkzLTHoqiy4V; Mon, 17 Jul 2023 20:49:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1689619775; bh=6EdZ+Gq8+oaEzVh78T6j0Vq20F8gxMukgxRTDtUERro=; h=From:To:Cc:Subject:Date; b=sxNEjaNaSFGblebLhoZgCspR3/b7PMWw5mvvcbiA1JPdCVOiD0EcAzet5fqmrBLF0 g1kJA04ScN0oLMVrH4T0js02kJvMR5ByBFj85S3S263Cai7ZlGu9TueW4SLJB59Nxr yNr1SrsLma5wvNJutFL013ubT61mwc2VkIW7B1vS1WgiZEA39BUysRBJDv3H3rLPTb pWvr1ye+zaTo4e7HiCsKYaVJiH9p8aKlYdZ3+ZFyBSC7oBIXCzPJWWFrbUeDnCi/Zc ncTIfUd0VPZ4Pw8VuSOu+/IXZUpeo1Dk6aHUaxZTE3KzUG70NVHYvE+EHhauumpuxY R6XZR7RXCKgVw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 17 Jul 2023 20:49:35 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Matthew Auld , Maarten Lankhorst Date: Mon, 17 Jul 2023 20:49:31 +0200 Message-Id: <7a036b88671312ee9adc01c74ef5b3376f690b76.1689619758.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915: Fix an error handling path in igt_write_huge() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christophe JAILLET , intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti --- /!\ 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; + } max_page_size = rounddown_pow_of_two(obj->mm.page_sizes.sg); max = div_u64(max - size, max_page_size);