]> Git Repo - linux.git/commitdiff
tee/optee/shm_pool: fix application of sizeof to pointer
authorjing yangyang <[email protected]>
Fri, 20 Aug 2021 03:21:27 +0000 (20:21 -0700)
committerJens Wiklander <[email protected]>
Tue, 14 Sep 2021 05:54:56 +0000 (07:54 +0200)
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 <[email protected]>
Reported-by: Zeal Robot <[email protected]>
Signed-off-by: jing yangyang <[email protected]>
Signed-off-by: Jens Wiklander <[email protected]>
drivers/tee/optee/shm_pool.c

index c41a9a501a6e9d8fcf5efce43259aca6466368b6..d167039af519eb904d9bc432e57e2e20b7fa9a57 100644 (file)
@@ -35,7 +35,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm,
                unsigned int nr_pages = 1 << order, i;
                struct page **pages;
 
-               pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL);
+               pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL);
                if (!pages) {
                        rc = -ENOMEM;
                        goto err;
This page took 0.052267 seconds and 4 git commands to generate.