public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/imagination: Use pvr_vm_context_get()
@ 2024-08-28 13:09 Matt Coster
  2024-08-30 13:59 ` Frank Binns
  2024-08-30 15:06 ` [PATCH RESEND] " Matt Coster
  0 siblings, 2 replies; 4+ messages in thread
From: Matt Coster @ 2024-08-28 13:09 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
  Cc: Frank Binns


[-- Attachment #1.1: Type: text/plain, Size: 960 bytes --]

I missed this open-coded kref_get() while trying to debug a refcount
bug, so let's use the helper function here to avoid that waste of time
again in the future.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code")
---
  drivers/gpu/drm/imagination/pvr_vm.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/imagination/pvr_vm.c 
b/drivers/gpu/drm/imagination/pvr_vm.c
index e59517ba039e..ffd466509d0b 100644
--- a/drivers/gpu/drm/imagination/pvr_vm.c
+++ b/drivers/gpu/drm/imagination/pvr_vm.c
@@ -636,9 +636,7 @@ pvr_vm_context_lookup(struct pvr_file *pvr_file, u32 
handle)
   	xa_lock(&pvr_file->vm_ctx_handles);
  	vm_ctx = xa_load(&pvr_file->vm_ctx_handles, handle);
-	if (vm_ctx)
-		kref_get(&vm_ctx->ref_count);
-
+	pvr_vm_context_get(vm_ctx);
  	xa_unlock(&pvr_file->vm_ctx_handles);
   	return vm_ctx;
-- 
2.46.0



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-02  7:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 13:09 [PATCH] drm/imagination: Use pvr_vm_context_get() Matt Coster
2024-08-30 13:59 ` Frank Binns
2024-08-30 15:06 ` [PATCH RESEND] " Matt Coster
2024-09-02  7:57   ` Frank Binns

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox