lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190311132938.GG2665@phenom.ffwll.local>
Date:   Mon, 11 Mar 2019 14:29:38 +0100
From:   Daniel Vetter <daniel@...ll.ch>
To:     Rodrigo Siqueira <rodrigosiqueiramelo@...il.com>
Cc:     Daniel Vetter <daniel@...ll.ch>, David Airlie <airlied@...ux.ie>,
        Haneen Mohammed <hamohammed.sa@...il.com>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/vkms: Remove useless call to drm_connector_register()

On Sun, Mar 10, 2019 at 06:22:41PM -0300, Rodrigo Siqueira wrote:
> The function vkms_output_init() is invoked during the module
> initialization, and it handles the creation/configuration of the vkms
> essential elements (e.g., connectors, encoder, etc). Among the
> initializations, this function tries to initialize a connector and
> register it by calling drm_connector_register(). However, inside the
> drm_connector_register(), at the beginning of this function there is the
> following validation:
> 
>  if (!connector->dev->registered)
>    return 0;
> 
> In this sense, invoke drm_connector_register() after initializing the
> connector has no effect because the register field is false. The
> connector register happens when drm_dev_register() is invoked.
> Therefore, this commit removes the drm_connector_register() from
> vkms_output_init().
> 
> Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@...il.com>
> ---
>  drivers/gpu/drm/vkms/vkms_output.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
> index 3b162b25312e..a6cee4c279c2 100644
> --- a/drivers/gpu/drm/vkms/vkms_output.c
> +++ b/drivers/gpu/drm/vkms/vkms_output.c
> @@ -71,12 +71,6 @@ int vkms_output_init(struct vkms_device *vkmsdev)
>  
>  	drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
>  
> -	ret = drm_connector_register(connector);

Yeah that's only needed for connectors added when hotplugging at runtime,
not for connectors which are created at driver load time.

Reviewed-by: Daniel Vetter <daniel.vetter@...ll.ch>

btw same issue exists with the drm_connector_unregister, that's also not
needed.
-Daniel

> -	if (ret) {
> -		DRM_ERROR("Failed to register connector\n");
> -		goto err_connector_register;
> -	}
> -
>  	ret = drm_encoder_init(dev, encoder, &vkms_encoder_funcs,
>  			       DRM_MODE_ENCODER_VIRTUAL, NULL);
>  	if (ret) {
> -- 
> 2.21.0

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ