Skip to content

Commit 8c666e6

Browse files
icklegregkh
authored andcommitted
drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all
commit d18d1a5 upstream. To acquire all modeset locks requires a ww_ctx to be allocated. As this is the legacy path and the allocation small, to reduce the changes required (and complex untested error handling) to the legacy drivers, we simply assume that the allocation succeeds. At present, it relies on the too-small-to-fail rule, but syzbot found that by injecting a failure here we would hit the WARN. Document that this allocation must succeed with __GFP_NOFAIL. Signed-off-by: Chris Wilson <[email protected]> Cc: Daniel Vetter <[email protected]> Reported-by: syzbot <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3587188 commit 8c666e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/drm_modeset_lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void drm_modeset_lock_all(struct drm_device *dev)
8888
struct drm_modeset_acquire_ctx *ctx;
8989
int ret;
9090

91-
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
91+
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL);
9292
if (WARN_ON(!ctx))
9393
return;
9494

0 commit comments

Comments
 (0)