dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/connector: Set DDC pointer in drmm_connector_init
@ 2022-10-19 14:34 Maxime Ripard
  2022-10-19 15:38 ` Thomas Zimmermann
  2022-10-20  8:54 ` Maxime Ripard
  0 siblings, 2 replies; 3+ messages in thread
From: Maxime Ripard @ 2022-10-19 14:34 UTC (permalink / raw)
  To: Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann, Maxime Ripard
  Cc: dri-devel

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index e3142c8142b3..61c29ce74b03 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -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;
 
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/connector: Set DDC pointer in drmm_connector_init
  2022-10-19 14:34 [PATCH] drm/connector: Set DDC pointer in drmm_connector_init Maxime Ripard
@ 2022-10-19 15:38 ` Thomas Zimmermann
  2022-10-20  8:54 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Zimmermann @ 2022-10-19 15:38 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, David Airlie, Maarten Lankhorst; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1554 bytes --]



Am 19.10.22 um 16:34 schrieb 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.
> 
> 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>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/gpu/drm/drm_connector.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index e3142c8142b3..61c29ce74b03 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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;
>   

-- 
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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/connector: Set DDC pointer in drmm_connector_init
  2022-10-19 14:34 [PATCH] drm/connector: Set DDC pointer in drmm_connector_init Maxime Ripard
  2022-10-19 15:38 ` Thomas Zimmermann
@ 2022-10-20  8:54 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2022-10-20  8:54 UTC (permalink / raw)
  To: Maxime Ripard, David Airlie, Thomas Zimmermann, Daniel Vetter,
	Maarten Lankhorst
  Cc: dri-devel

On Wed, 19 Oct 2022 16:34:42 +0200, Maxime Ripard wrote:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-20  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 14:34 [PATCH] drm/connector: Set DDC pointer in drmm_connector_init Maxime Ripard
2022-10-19 15:38 ` Thomas Zimmermann
2022-10-20  8:54 ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).