[PATCH 2/4] drm: remove dead WARN_ON NULL check after GFP_NOFAIL allocation
Gou Hao <[email protected]>
| Newsgroups | gmane.linux.ports.ppc.embedded |
|---|---|
| Message-ID | <20260723081813.176792-3-gouhao__47779.8090594419$1784811621$gmane$org@uniontech.com> |
kzalloc_obj with the __GFP_NOFAIL flag will never return NULL, so the subsequent WARN_ON(!ctx) is unreachable dead code. Remove it. Signed-off-by: Gou Hao <[email protected]> --- drivers/gpu/drm/drm_modeset_lock.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c index 2c806b0146d6..e14814c30d8c 100644 --- a/drivers/gpu/drm/drm_modeset_lock.c +++ b/drivers/gpu/drm/drm_modeset_lock.c @@ -149,11 +149,7 @@ void drm_modeset_lock_all(struct drm_device *dev) int ret; ctx = kzalloc_obj(*ctx, GFP_KERNEL | __GFP_NOFAIL); - if (WARN_ON(!ctx)) - return; - mutex_lock(&config->mutex); - drm_modeset_acquire_init(ctx, 0); retry: -- 2.20.1