mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
Compare commits
1 Commits
rel-36
...
jetson_36.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff0c2e64e9 |
@@ -256,12 +256,20 @@ static void destroy_client(struct nvmap_client *client)
|
||||
if (!client)
|
||||
return;
|
||||
|
||||
mutex_lock(&nvmap_dev->clients_lock);
|
||||
/*
|
||||
* count field tracks the number of namespaces within a process.
|
||||
* Destroy the client only after all namespaces close the /dev/nvmap node.
|
||||
*/
|
||||
if (atomic_dec_return(&client->count)) {
|
||||
mutex_unlock(&nvmap_dev->clients_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
nvmap_id_array_exit(&client->id_array);
|
||||
#ifdef NVMAP_CONFIG_HANDLE_AS_ID
|
||||
client->ida = NULL;
|
||||
#endif
|
||||
|
||||
mutex_lock(&nvmap_dev->clients_lock);
|
||||
if (!IS_ERR_OR_NULL(nvmap_dev->handles_by_pid)) {
|
||||
pid_t pid = nvmap_client_pid(client);
|
||||
nvmap_pid_put_locked(nvmap_dev, pid);
|
||||
@@ -328,13 +336,7 @@ static int nvmap_release(struct inode *inode, struct file *filp)
|
||||
return 0;
|
||||
|
||||
trace_nvmap_release(priv, priv->name);
|
||||
/*
|
||||
* count field tracks the number of namespaces within a process.
|
||||
* Destroy the client only after all namespaces close the /dev/nvmap node.
|
||||
*/
|
||||
if (!atomic_dec_return(&priv->count))
|
||||
destroy_client(priv);
|
||||
|
||||
destroy_client(priv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user