kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2] drm/etnaviv: fix ref count leak via pm_runtime_get_sync
@ 2020-06-15 15:57 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2020-06-15 15:57 UTC (permalink / raw)
  To: Navid Emamdoost, dri-devel, etnaviv, linux+etnaviv
  Cc: David Airlie, Kangjie Lu, kernel-janitors, linux-kernel,
	Stephen McCamant, Andy Shevchenko, Navid Emamdoost, Qiushi Wu

…
> 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-15 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 15:57 [PATCH v2] drm/etnaviv: fix ref count leak via pm_runtime_get_sync Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).