drm: Preload IDR during change_handle
Subsystems (2)
PATCH 1/1 drm: Preload IDR during change_handle
change_handle mistakenly had an idr allocation using GFP_NOWAIT without preload. This could lead to idr being unable to allocate needed memory.
Use idr_preload to prevent this (as in create_tail)
Signed-off-by David Francis <[email protected]>
--- drivers/gpu/drm/drm_gem.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/drm_gem.c +4 -0
@@ -1039,10 +1039,14 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data,mutex_lock (&file_priv->prime.lock); +idr_preload (GFP_KERNEL );spin_lock (&file_priv->table_lock); + ret =idr_alloc (&file_priv->object_idr, obj, handle, handle +1 ,GFP_NOWAIT ); +spin_unlock (&file_priv->table_lock); +idr_preload_end ();if (ret <0 ) goto out_unlock;
Signature · 1 line
2.34.1