From: Chris Wilson Date: Sat, 23 Dec 2017 11:04:07 +0000 (+0000) Subject: drm/i915/selftests: Allow random array allocation to fail X-Git-Tag: v4.19~298^2~46^2~849 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9861b6682804a9db82600e0adf592bfa6deec377;p=platform%2Fkernel%2Flinux-rpi.git drm/i915/selftests: Allow random array allocation to fail In the selftests, we don't want to force an oom and would rather ENOMEM be reported. In this case, we would rather the allocation for the random array to fail. Signed-off-by: Chris Wilson Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20171223110407.21402-2-chris@chris-wilson.co.uk --- diff --git a/drivers/gpu/drm/i915/selftests/i915_random.c b/drivers/gpu/drm/i915/selftests/i915_random.c index 2088ae5..1f415ce 100644 --- a/drivers/gpu/drm/i915/selftests/i915_random.c +++ b/drivers/gpu/drm/i915/selftests/i915_random.c @@ -57,7 +57,8 @@ unsigned int *i915_random_order(unsigned int count, struct rnd_state *state) { unsigned int *order, i; - order = kmalloc_array(count, sizeof(*order), GFP_KERNEL | __GFP_NOWARN); + order = kmalloc_array(count, sizeof(*order), + GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); if (!order) return order;