diff --git a/crypto-qti/qcedev_smmu.c b/crypto-qti/qcedev_smmu.c index 399655f09c..9dee812ebb 100644 --- a/crypto-qti/qcedev_smmu.c +++ b/crypto-qti/qcedev_smmu.c @@ -344,8 +344,12 @@ int qcedev_check_and_map_buffer(void *handle, return 0; unmap: - if (!found) + if (!found) { qcedev_unmap_buffer(handle, mem_client, binfo); + mutex_lock(&qce_hndl->registeredbufs.lock); + list_del(&binfo->list); + mutex_unlock(&qce_hndl->registeredbufs.lock); + } error: kfree(binfo); diff --git a/smcinvoke/smcinvoke.c b/smcinvoke/smcinvoke.c index ba3311e411..12b16299a0 100644 --- a/smcinvoke/smcinvoke.c +++ b/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);