Re: [PATCH 2/4] drm/tegra: gr2d: Properly clean up resources

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04.05.2018 16:37, Thierry Reding wrote:
> From: Thierry Reding <treding@xxxxxxxxxx>
> 
> Failure to register the Tegra DRM client would leak the resources. Move
> cleanup code to error unwinding gotos to fix that and share the cleanup
> code with the other error paths.
> 
> Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/tegra/gr2d.c | 28 ++++++++++++++++++++++------
>  1 file changed, 22 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c
> index 8eb530a85dd0..0b42e99da8ad 100644
> --- a/drivers/gpu/drm/tegra/gr2d.c
> +++ b/drivers/gpu/drm/tegra/gr2d.c
> @@ -42,8 +42,9 @@ static int gr2d_init(struct host1x_client *client)
>  
>  	client->syncpts[0] = host1x_syncpt_request(client, flags);
>  	if (!client->syncpts[0]) {
> -		host1x_channel_put(gr2d->channel);
> -		return -ENOMEM;
> +		err = -ENOMEM;
> +		dev_err(client->dev, "failed to request syncpoint: %d\n", err);

Nit: You could add the same error message to the gr3d patch for consistency.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux