drm/i915: release context ID when context creation fails
Subsystems (2)
PATCH 1/1 drm/i915: release context ID when context creation fails
On graphics version 13 and later, xa_alloc() reserves a context ID before i915_gem_create_context() is called. If context creation fails, the reserved entry is left in context_xa, making the ID unavailable to later context allocations on the same DRM file.
Release the unused XArray reservation on the failure path.
---
Compile-tested the affected object with x86_64 allmodconfig
and W=1 (GCC 13.3.0). Base: mainline 3b7cab693ba2bab63774bf5b988e8a61b2ef0f32. No hardware testing or runtime failure reproduction was performed.
drivers/gpu/drm/i915/gem/i915_gem_context.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/gem/i915_gem_context.c +1 -0
@@ -2421,6 +2421,7 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, ctx =i915_gem_create_context (i915, ext_data.pc);if (IS_ERR (ctx)) { ret =PTR_ERR (ctx); +xa_release (&ext_data.fpriv->context_xa, id); goto err_pc; }
Patchwork
CI✗ LGCI.VerificationFailed: failure for drm/i915: release context ID when context creation fails
== Series Details ==
== Series Details ==
Series: drm/i915: release context ID when context creation fails
URL : https://patchwork.freedesktop.org/series/175461/
State : failure
== Summary ==
Series author address '[email protected]' is not on the allowlist, which prevents CI from being automatically triggered. If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork. Exception occurred during validation, bailing out!
Build URL: http://gfx-ci.igk.intel.com:8080/job/CI_PW_kernel/188954/ (on built-in)