Re: [PATCH v2] drm/etnaviv: fix ref count leak via pm_runtime_get_sync

From: Markus Elfring
Date: Mon Jun 15 2020 - 11:57:59 EST


â
> In case of failure, decrement the ref count before returning.

Can it be nicer to use the term âreference countâ here?

Will the tag âFixesâ become helpful for the commit message?


â
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
â
> @@ -1326,6 +1331,7 @@ struct dma_fence *etnaviv_gpu_submit(struct etnaviv_gem_submit *submit)
> ret = event_alloc(gpu, nr_events, event);
> if (ret) {
> DRM_ERROR("no free events\n");
> + pm_runtime_put_noidle(gpu->dev);
> return NULL;
> }

I suggest to move a bit of exception handling code to the end of
this function implementation so that it can be better reused after
the addition of a jump target like âput_runtimeâ.

Regards,
Markus