drm/ttm: Fix TTM object open regression
authorThomas Hellstrom <thellstrom@vmware.com>
Fri, 24 Jan 2014 07:49:45 +0000 (08:49 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 5 Feb 2014 08:29:25 +0000 (09:29 +0100)
Commit drm/ttm: ttm object security fixes for render nodes introduced a
regression where, if a TTM object was opened multiple times from the same
open file, the caller would spin uninterruptibly in the kernel.

Fix this.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
drivers/gpu/drm/ttm/ttm_object.c

index 3707985..53b51c4 100644 (file)
@@ -292,7 +292,7 @@ int ttm_ref_object_add(struct ttm_object_file *tfile,
 
                if (ret == 0) {
                        ref = drm_hash_entry(hash, struct ttm_ref_object, hash);
-                       if (!kref_get_unless_zero(&ref->kref)) {
+                       if (kref_get_unless_zero(&ref->kref)) {
                                rcu_read_unlock();
                                break;
                        }