diff mbox series

[SRU,F,v2,4/7] drm/gem: add drm_gem_object_put helper

Message ID 20240308201150.25987-5-bethany.jamison@canonical.com
State New
Headers show
Series CVE-2023-39198 | expand

Commit Message

Bethany Jamison March 8, 2024, 8:11 p.m. UTC
From: Emil Velikov <emil.velikov@collabora.com>

Spelling out _unlocked for each and every driver is a annoying.
Especially if we consider how many drivers, do not know (or need to)
about the horror stories involving struct_mutex.

Add helper, which will allow us to transition the drivers one by one,
dropping the suffix.

v2: add missing space after function name (Jani)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org> (v1)
Reviewed-by: Steven Price <steven.price@arm.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-13-emil.l.velikov@gmail.com
(cherry picked from commit 2f4dd13d4bb8a85f6d5b66a18989509924e4f5e9)
CVE-2023-39198
Signed-off-by: Bethany Jamison <bethany.jamison@canonical.com>
---
 include/drm/drm_gem.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index 585addb0cd1c..8c9a2748acd8 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -350,17 +350,19 @@  static inline void drm_gem_object_get(struct drm_gem_object *obj)
 }
 
 /**
- * drm_gem_object_put_unlocked - drop a GEM buffer object reference
+ * drm_gem_object_put - drop a GEM buffer object reference
  * @obj: GEM buffer object
  *
  * This releases a reference to @obj.
  */
 static inline void
-drm_gem_object_put_unlocked(struct drm_gem_object *obj)
+drm_gem_object_put(struct drm_gem_object *obj)
 {
 	kref_put(&obj->refcount, drm_gem_object_free);
 }
 
+#define drm_gem_object_put_unlocked drm_gem_object_put
+
 void drm_gem_object_put_locked(struct drm_gem_object *obj);
 
 int drm_gem_handle_create(struct drm_file *file_priv,