[PATCH] drm/amdgpu: fix warning in dce_virtual.c

Edward O'Callaghan funfunctor at folklore1984.net
Sat Oct 15 10:35:11 UTC 2016


Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>

if possible can you squash it into the original bad commit?

On 10/15/2016 05:00 AM, Alex Deucher wrote:
> copy paste typo when I re-arranged the code.
> 
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> index 2eefa5d..48973b7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> @@ -657,18 +657,18 @@ static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
>  
>  	/* add a new encoder */
>  	encoder = kzalloc(sizeof(struct drm_encoder), GFP_KERNEL);
> -	if (!encoder) {
> -		kfree(connector);
> +	if (!encoder)
>  		return -ENOMEM;
> -	}
>  	encoder->possible_crtcs = 1 << index;
>  	drm_encoder_init(adev->ddev, encoder, &dce_virtual_encoder_funcs,
>  			 DRM_MODE_ENCODER_VIRTUAL, NULL);
>  	drm_encoder_helper_add(encoder, &dce_virtual_encoder_helper_funcs);
>  
>  	connector = kzalloc(sizeof(struct drm_connector), GFP_KERNEL);
> -	if (!connector)
> +	if (!connector) {
> +		kfree(encoder);
>  		return -ENOMEM;
> +	}
>  
>  	/* add a new connector */
>  	drm_connector_init(adev->ddev, connector, &dce_virtual_connector_funcs,
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20161015/f86830e0/attachment.sig>


More information about the amd-gfx mailing list