drm/i915: Fix an error handling path in igt_write_huge()
authorjsg <jsg@openbsd.org>
Fri, 4 Aug 2023 09:13:44 +0000 (09:13 +0000)
committerjsg <jsg@openbsd.org>
Fri, 4 Aug 2023 09:13:44 +0000 (09:13 +0000)
From Christophe JAILLET
a71cd15a8592482bc3adead423ec4ff4502f0a72 in linux-6.1.y/6.1.43
e354f67733115b4453268f61e6e072e9b1ea7a2f in mainline linux

sys/dev/pci/drm/i915/gem/selftests/huge_pages.c

index 6fe080a..57ce058 100644 (file)
@@ -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);