tee/optee/shm_pool: fix application of sizeof to pointer

sizeof when applied to a pointer typed expression gives the size of
the pointer.

./drivers/tee/optee/shm_pool.c:38:28-34: ERROR application of sizeof to pointer

This issue was detected with the help of Coccinelle.

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This commit is contained in:
jing yangyang 2021-08-19 20:21:27 -07:00 committed by Jens Wiklander
parent 7d2a07b769
commit 88a3856c0a
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm,
unsigned int nr_pages = 1 << order, i; unsigned int nr_pages = 1 << order, i;
struct page **pages; struct page **pages;
pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL); pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL);
if (!pages) { if (!pages) {
rc = -ENOMEM; rc = -ENOMEM;
goto err; goto err;