From: jsg Date: Fri, 4 Aug 2023 09:13:44 +0000 (+0000) Subject: drm/i915: Fix an error handling path in igt_write_huge() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f2191f778bef4f555bc236038b0fec07367533cb;p=openbsd drm/i915: Fix an error handling path in igt_write_huge() From Christophe JAILLET a71cd15a8592482bc3adead423ec4ff4502f0a72 in linux-6.1.y/6.1.43 e354f67733115b4453268f61e6e072e9b1ea7a2f in mainline linux --- diff --git a/sys/dev/pci/drm/i915/gem/selftests/huge_pages.c b/sys/dev/pci/drm/i915/gem/selftests/huge_pages.c index 6fe080abd73..57ce0584cf4 100644 --- a/sys/dev/pci/drm/i915/gem/selftests/huge_pages.c +++ b/sys/dev/pci/drm/i915/gem/selftests/huge_pages.c @@ -1185,8 +1185,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);