Skip to contentSkip to conversation

drm: Add check for encoder in intel_get_crtc_new_encoder()

PATCH New George Rurikov 2 participants 3 messages Sep 24, 2024 – Oct 1, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Add check for encoder in intel_get_crtc_new_encoder()

If the video card driver could not find the connector assigned to the current video controller, or if the hardware status has changed so that a pre-existing connector is no longer active, none of the state connectors will meet the assignment criteria for the current crtc video controller.

In the drm_WARN function, encoder->base.dev is called, so '&encoder->base.dev' will be dereferenced since encoder will still be initialized NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes e12d6218fda2 ("drm/i915: Reduce bigjoiner special casing")
---
 drivers/gpu/drm/i915/display/intel_display.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +4 -3
index b4ef4d59da1a..a5e24d64f909 100644
@@ -819,9 +819,10 @@ intel_get_crtc_new_encoder(const struct intel_atomic_state *state,
                num_encoders++;
        }
 
-       drm_WARN(state->base.dev, num_encoders != 1,
-                "%d encoders for pipe %c\n",
-                num_encoders, pipe_name(primary_crtc->pipe));
+       if (encoder)
+               drm_WARN(state->base.dev, num_encoders != 1,
+                       "%d encoders for pipe %c\n",
+                       num_encoders, pipe_name(primary_crtc->pipe));
 
        return encoder;
 }

--
2.34.1

Заявление о конфиденциальности

Данное электронное письмо и любые приложения к нему являются конфиденциальными и предназначены исключительно для адресата. Если Вы не являетесь адресатом данного письма, пожалуйста, уведомите немедленно отправителя, не раскрывайте содержание другим лицам, не используйте его в каких-либо целях, не храните и не копируйте информацию любым способом.

#1 lore raw

✗ CI.Patch_applied: failure for drm: Add check for encoder in intel_get_crtc_new_encoder() (rev3)

== Series Details ==

== Series Details ==

Series: drm: Add check for encoder in intel_get_crtc_new_encoder() (rev3)
URL : https://patchwork.freedesktop.org/series/139111/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: ec87b409d3a9 drm-tip: 2024y-09m-26d-13h-48m-52s UTC integration manifest === git am output follows ===
error: patch failed: drivers/gpu/drm/i915/display/intel_display.c:819
error: drivers/gpu/drm/i915/display/intel_display.c: patch does not apply
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Applying: drm: Add check for encoder in intel_get_crtc_new_encoder() Patch failed at 0001 drm: Add check for encoder in intel_get_crtc_new_encoder() When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

#2 lore raw

✗ Fi.CI.BUILD: failure for drm: Add check for encoder in intel_get_crtc_new_encoder() (rev3)

In reply to George Rurikov
== Series Details ==

== Series Details ==

Series: drm: Add check for encoder in intel_get_crtc_new_encoder() (rev3)
URL : https://patchwork.freedesktop.org/series/139314/
State : failure

== Summary ==

Error: patch https://patchwork.freedesktop.org/api/1.0/series/139314/revisions/3/mbox/ not applied
Applying: drm: Add check for encoder in intel_get_crtc_new_encoder()
error: patch failed: drivers/gpu/drm/i915/display/intel_display.c:819
error: drivers/gpu/drm/i915/display/intel_display.c: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/display/intel_display.c
Patch failed at 0001 drm: Add check for encoder in intel_get_crtc_new_encoder() When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Build failed, no error log produced