Skip to contentSkip to conversation

drm/connector: Set DDC pointer in drmm_connector_init

PATCH Applied Maxime Ripard 2 participants 3 messages Oct 19, 2022 – Oct 20, 2022

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

PATCH 1/1 drm/connector: Set DDC pointer in drmm_connector_init

Commit 35a3b82f1bdd ("drm/connector: Introduce drmm_connector_init") introduced the function drmm_connector_init() with a parameter for an optional ddc pointer to the i2c controller used to access the DDC bus.

However, the underlying call to __drm_connector_init() was always setting it to NULL instead of passing the ddc argument around.

This resulted in unexpected null pointer dereference on platforms expecting to get a DDC controller.

Fixes 35a3b82f1bdd ("drm/connector: Introduce drmm_connector_init")
---
 drivers/gpu/drm/drm_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +1 -1
index e3142c8142b3..61c29ce74b03 100644
@@ -435,7 +435,7 @@ int drmm_connector_init(struct drm_device *dev,
 	if (drm_WARN_ON(dev, funcs && funcs->destroy))
 		return -EINVAL;
 
-	ret = __drm_connector_init(dev, connector, funcs, connector_type, NULL);
+	ret = __drm_connector_init(dev, connector, funcs, connector_type, ddc);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.37.3
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 19.10.22 um 16:34 schrieb Maxime Ripard:

Quoted 4 lines

Commit 35a3b82f1bdd ("drm/connector: Introduce drmm_connector_init") introduced the function drmm_connector_init() with a parameter for an optional ddc pointer to the i2c controller used to access the DDC bus.

Quoted 8 lines

However, the underlying call to __drm_connector_init() was always setting it to NULL instead of passing the ddc argument around.

This resulted in unexpected null pointer dereference on platforms expecting to get a DDC controller.

Fixes 35a3b82f1bdd ("drm/connector: Introduce drmm_connector_init")
Quoted 17 lines
---
  drivers/gpu/drm/drm_connector.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +1 -1
index e3142c8142b3..61c29ce74b03 100644
@@ -435,7 +435,7 @@ int drmm_connector_init(struct drm_device *dev,
  	if (drm_WARN_ON(dev, funcs && funcs->destroy))
  		return -EINVAL;
 
-	ret = __drm_connector_init(dev, connector, funcs, connector_type, NULL);
+	ret = __drm_connector_init(dev, connector, funcs, connector_type, ddc);
  	if (ret)
  		return ret;
 
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
author Applied
#2 lore raw
In reply to Maxime Ripard
Quoted 8 lines · Maxime Ripard

Commit 35a3b82f1bdd ("drm/connector: Introduce drmm_connector_init") introduced the function drmm_connector_init() with a parameter for an optional ddc pointer to the i2c controller used to access the DDC bus.

However, the underlying call to __drm_connector_init() was always setting it to NULL instead of passing the ddc argument around.

[...]

Applied to drm/drm-misc (drm-misc-fixes).

Thanks!
Maxime