From: jsg Date: Thu, 15 Jun 2023 02:39:37 +0000 (+0000) Subject: drm/i915: Fix NULL ptr deref by checking new_crtc_state X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7e2e87fc7325c1e4094938c52006cade0dfbb54a;p=openbsd drm/i915: Fix NULL ptr deref by checking new_crtc_state From Stanislav Lisovskiy dbf25cc21beff4fd2e730573845a266504b21bb2 in linux-6.1.y/6.1.30 a41d985902c153c31c616fe183cf2ee331e95ecb in mainline linux --- diff --git a/sys/dev/pci/drm/i915/display/intel_atomic_plane.c b/sys/dev/pci/drm/i915/display/intel_atomic_plane.c index aaa6708256d..82826454b5e 100644 --- a/sys/dev/pci/drm/i915/display/intel_atomic_plane.c +++ b/sys/dev/pci/drm/i915/display/intel_atomic_plane.c @@ -988,7 +988,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane, int ret; if (old_obj) { - const struct intel_crtc_state *crtc_state = + const struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, to_intel_crtc(old_plane_state->hw.crtc)); @@ -1003,7 +1003,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane, * This should only fail upon a hung GPU, in which case we * can safely continue. */ - if (intel_crtc_needs_modeset(crtc_state)) { + if (new_crtc_state && intel_crtc_needs_modeset(new_crtc_state)) { ret = i915_sw_fence_await_reservation(&state->commit_ready, old_obj->base.resv, NULL, false, 0,