mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
OP-TEE: fix missing mutex unlock
Change-Id: I4b4ba136b94da4dbe8d1fa561dbd03f7addfb350 Signed-off-by: Elon Zhang <zhangzj@rock-chips.com>
This commit is contained in:
@@ -180,6 +180,7 @@ struct shm_pool *tee_shm_pool_create(struct device *dev, size_t shm_size,
|
||||
chunk = _KMALLOC(sizeof(struct mem_chunk), GFP_KERNEL);
|
||||
if (!chunk) {
|
||||
dev_err(dev, "kmalloc <struct MemChunk> failed\n");
|
||||
mutex_unlock(&pool->lock);
|
||||
goto alloc_failed;
|
||||
}
|
||||
memset(chunk, 0, sizeof(*chunk));
|
||||
@@ -558,6 +559,7 @@ int rk_tee_shm_pool_free(struct device *dev, struct shm_pool *pool,
|
||||
dev_warn(dev,
|
||||
"< tee_shm_pool_free() WARNING, paddr=0x%p already released\n",
|
||||
(void *)paddr);
|
||||
mutex_unlock(&pool->lock);
|
||||
return -EINVAL;
|
||||
} else if (--chunk->counter == 0) {
|
||||
dev_dbg(dev, "paddr=%p\n", (void *)paddr);
|
||||
|
||||
Reference in New Issue
Block a user