Pārlūkot izejas kodu

securemsm-kernel: smcinvoke: Decrement the server object ref count in mutex context

Decrement the smcinvoke server object refcount in mutex context so that
we never get an object which is being freed.

Change-Id: I16c9c7f2518e8f2d7749d4556f5c7bf2ef5878af
Signed-off-by: Nishant Pandey <[email protected]>
Nishant Pandey 9 mēneši atpakaļ
vecāks
revīzija
38a7d22953
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      smcinvoke/smcinvoke.c

+ 4 - 1
smcinvoke/smcinvoke.c

@@ -2750,8 +2750,11 @@ start_waiting_for_requests:
 		}
 	} while (!cb_txn);
 out:
-	if (server_info)
+	if (server_info) {
+		mutex_lock(&g_smcinvoke_lock);
 		kref_put(&server_info->ref_cnt, destroy_cb_server);
+		mutex_unlock(&g_smcinvoke_lock);
+	}
 
 	if (ret && ret != -ERESTARTSYS)
 		pr_err("accept thread returning with ret: %d\n", ret);