drm: bridge: dw_hdmi: fix connector access for scdc
authorAdrián Larumbe <adrian.larumbe@collabora.com>
Thu, 1 Jun 2023 12:31:53 +0000 (13:31 +0100)
committerNeil Armstrong <neil.armstrong@linaro.org>
Thu, 22 Jun 2023 12:49:56 +0000 (14:49 +0200)
commit98703e4e061fb8715c7613cd227e32cdfd136b23
tree9ea709e0796667550c7c03ecf199d6663111edef
parente30cb0599799aac099209e3b045379613c80730e
drm: bridge: dw_hdmi: fix connector access for scdc

Commit 5d844091f237 ("drm/scdc-helper: Pimp SCDC debugs") changed the scdc
interface to pick up an i2c adapter from a connector instead. However, in
the case of dw-hdmi, the wrong connector was being used to pass i2c adapter
information, since dw-hdmi's embedded connector structure is only populated
when the bridge attachment callback explicitly asks for it.

drm-meson is handling connector creation, so this won't happen, leading to
a NULL pointer dereference.

Fix it by having scdc functions access dw-hdmi's current connector pointer
instead, which is assigned during the bridge enablement stage.

Fixes: 5d844091f237 ("drm/scdc-helper: Pimp SCDC debugs")
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Reported-by: Lukas F. Hartmann <lukas@mntre.com>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
[narmstrong: moved Fixes tag before first S-o-b and added Reported-by tag]
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230601123153.196867-1-adrian.larumbe@collabora.com
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c