提交 d90efc9e 编写于 作者: Y Yakir Yang 提交者: Inki Dae

drm/exynos: dp: Fix NULL pointer dereference due uninitialized connector

Commit 3424e3a4 ("drm: bridge: analogix/dp: split exynos dp driver to
bridge directory") split the Exynos DP core driver into a core driver and
a bridge driver for the Analogix chip since that is also used by Rockchip.

But the change introduced a regression causing a NULL pointer dereference
when trying to access an uninitialized connector in the driver .get_modes:

Fix this by instead of having a connector struct for both the Exynos and
Analogix drivers, just use the connector initialized in the bridge driver.

Fixes: 3424e3a4 ("drm: bridge: analogix/dp: split exynos dp driver to bridge directory")
Reported-by: NMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: NYakir Yang <ykk@rock-chips.com>
Tested-by: NMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: NInki Dae <inki.dae@samsung.com>
上级 0ab15bde
......@@ -34,7 +34,7 @@
struct exynos_dp_device {
struct drm_encoder encoder;
struct drm_connector connector;
struct drm_connector *connector;
struct drm_bridge *ptn_bridge;
struct drm_device *drm_dev;
struct device *dev;
......@@ -70,7 +70,7 @@ static int exynos_dp_poweroff(struct analogix_dp_plat_data *plat_data)
static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data)
{
struct exynos_dp_device *dp = to_dp(plat_data);
struct drm_connector *connector = &dp->connector;
struct drm_connector *connector = dp->connector;
struct drm_display_mode *mode;
int num_modes = 0;
......@@ -103,6 +103,7 @@ static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
int ret;
drm_connector_register(connector);
dp->connector = connector;
/* Pre-empt DP connector creation if there's a bridge */
if (dp->ptn_bridge) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册