Skip to contentSkip to conversation

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

DISCUSSION kernel test robot 1 participant 2 messages Sep 14, 2020

Subsystems (2)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   856deb866d16e29bd65952e0289066f6078af773
commit: 5a769f6ff439cedc547395a6dc78faa26108f741 optee: Fix multi page dynamic shm pool alloc
date:   9 months ago
config: arm64-randconfig-c004-20200913 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate

coccinelle warnings: (new ones prefixed by >>)

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

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

author build bot
#1 lore raw

[PATCH] optee: fix noderef.cocci warnings

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

From: kernel test robot <[email protected]>

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

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

Generated by: scripts/coccinelle/misc/noderef.cocci

Fixes 5a769f6ff439 ("optee: Fix multi page dynamic shm pool alloc")
CC Sumit Garg <[email protected]>

---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   856deb866d16e29bd65952e0289066f6078af773
commit: 5a769f6ff439cedc547395a6dc78faa26108f741 optee: Fix multi page dynamic shm pool alloc
 shm_pool.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tee/optee/shm_pool.c +1 -1
@@ -31,7 +31,7 @@ static int pool_op_alloc(struct tee_shm_
 		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)
 			return -ENOMEM;