[Intel-gfx] [PATCH 1/3] drm/i915: Guard debugfs against invalid access without display

Jani Nikula jani.nikula at intel.com
Tue Oct 27 07:48:14 UTC 2020


On Mon, 26 Oct 2020, Lucas De Marchi <lucas.demarchi at intel.com> wrote:
> Do not create the display debugfs files when we don't have display.
>
> Based on previous patch by José Souza.
>
> Cc: José Roberto de Souza <jose.souza at intel.com>
> Cc: Jani Nikula <jani.nikula at intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index d3237b0d821d..d6e25212d5c0 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -671,7 +671,8 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
>  	/* Reveal our presence to userspace */
>  	if (drm_dev_register(dev, 0) == 0) {
>  		i915_debugfs_register(dev_priv);
> -		intel_display_debugfs_register(dev_priv);
> +		if (HAS_DISPLAY(dev_priv))
> +			intel_display_debugfs_register(dev_priv);
>  		i915_setup_sysfs(dev_priv);
>  
>  		/* Depends on sysfs having been initialized */

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list