diff --git a/drivers/misc/sdma-dae/sdma_auth.c b/drivers/misc/sdma-dae/sdma_auth.c index 6b6585a2e807ec47030d93f65a491355bec0353e..e634ef01e198c50f7ee6467abc6bf3d1f2ff2bb2 100644 --- a/drivers/misc/sdma-dae/sdma_auth.c +++ b/drivers/misc/sdma-dae/sdma_auth.c @@ -58,6 +58,9 @@ void sdma_authority_ht_free(void) struct hlist_node *tmp; u32 bkt; + if (g_authority == NULL) + return; + write_lock(&g_authority->owner_pid_lock); hash_for_each_safe(g_authority->sdma_owner_pid_ht, bkt, tmp, entry, node) entry_free_pid_ht(entry); @@ -87,6 +90,9 @@ void sdma_free_authority_ht_with_pid(u32 pid) struct hlist_node *tmp; u32 bkt; + if (g_authority == NULL) + return; + write_lock(&g_authority->owner_pid_lock); hash_for_each_safe(g_authority->sdma_owner_pid_ht, bkt, tmp, entry, node) { if (entry->pid == pid) diff --git a/drivers/misc/sdma-dae/sdma_umem.c b/drivers/misc/sdma-dae/sdma_umem.c index 55d687160af290fb30b8f60da75c443117d5757c..ba9424f854fa1dc7288a3fd6ee566a691c6d6e1a 100644 --- a/drivers/misc/sdma-dae/sdma_umem.c +++ b/drivers/misc/sdma-dae/sdma_umem.c @@ -66,6 +66,9 @@ void sdma_hash_free_entry(int key) struct hash_entry *entry; struct hlist_node *node_tmp; + if (g_hash_table == NULL) + return; + pr_debug("Function %s: free ida %d\n", __func__, key); spin_lock(&g_hash_table->hash_lock); @@ -82,6 +85,9 @@ void sdma_hash_free(void) struct hlist_node *tmp; u32 bkt; + if (g_hash_table == NULL) + return; + spin_lock(&g_hash_table->hash_lock); hash_for_each_safe(g_hash_table->sdma_fd_ht, bkt, tmp, entry, node)