drm/connector: Set DDC pointer in drmm_connector_init
authorMaxime Ripard <maxime@cerno.tech>
Wed, 19 Oct 2022 14:28:12 +0000 (16:28 +0200)
committerDom Cobley <popcornmix@gmail.com>
Fri, 4 Nov 2022 12:10:23 +0000 (12:10 +0000)
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")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/drm_connector.c

index dbd435e..3d9974d 100644 (file)
@@ -422,7 +422,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;