summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2023-07-17 15:15:44 +0200
committerJavier Martinez Canillas <javierm@redhat.com>2023-07-29 20:56:42 +0200
commitd0b4c1cf3375e8194d2cfde0b658f1850993c642 (patch)
tree9d1f5b7057d37f3558aa563d3a6695d739763e07 /drivers/gpu
parentdrm/nouveau/nvkm/dp: Add workaround to fix DP 1.3+ DPCD issues (diff)
downloadlinux-d0b4c1cf3375e8194d2cfde0b658f1850993c642.tar.xz
linux-d0b4c1cf3375e8194d2cfde0b658f1850993c642.zip
drm/bridge_connector: Handle drm_connector_init_with_ddc() failures
drm_connector_init_with_ddc() can fail, but the call in drm_bridge_connector_init() does not check that. Fix this by adding the missing error handling. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/3a7e9540d8dc94298d021aa2fb046ae8616ca4dd.1689599701.git.geert+renesas@glider.be
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_bridge_connector.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index fc6f16e14f36..1da93d5a1f61 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -318,6 +318,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
struct i2c_adapter *ddc = NULL;
struct drm_bridge *bridge, *panel_bridge = NULL;
int connector_type;
+ int ret;
bridge_connector = kzalloc(sizeof(*bridge_connector), GFP_KERNEL);
if (!bridge_connector)
@@ -368,8 +369,14 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
return ERR_PTR(-EINVAL);
}
- drm_connector_init_with_ddc(drm, connector, &drm_bridge_connector_funcs,
- connector_type, ddc);
+ ret = drm_connector_init_with_ddc(drm, connector,
+ &drm_bridge_connector_funcs,
+ connector_type, ddc);
+ if (ret) {
+ kfree(bridge_connector);
+ return ERR_PTR(ret);
+ }
+
drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
if (bridge_connector->bridge_hpd)