From e9b818e763d45692e9cc729ab17a21f260473fb4 Mon Sep 17 00:00:00 2001 From: Vinayak Chettimada Date: Wed, 16 Nov 2016 11:14:27 +0100 Subject: [PATCH] Bluetooth: Controller: Fix suspicious use of sizeof Fix Coverity, sizeof not portable, defect; by explicitly using sizeof(void *). suspicious_sizeof: Passing argument mem_head of type void ** and argument 4U /* sizeof (mem_head) */ to function memcpy is suspicious. In this case, sizeof (void **) is equal to sizeof (void *), but this is not a portable assumption. Change-id: I4b4776466e16020876500feba0141985b8581017 Signed-off-by: Vinayak Chettimada --- subsys/bluetooth/controller/util/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/util/mem.c b/subsys/bluetooth/controller/util/mem.c index 187c506efc4..855222ea806 100644 --- a/subsys/bluetooth/controller/util/mem.c +++ b/subsys/bluetooth/controller/util/mem.c @@ -59,7 +59,7 @@ void *mem_acquire(void **mem_head) free_count--; mem = *mem_head; - memcpy(mem_head, mem, sizeof(mem_head)); + memcpy(mem_head, mem, sizeof(*mem_head)); /* Store free mem_count after the list's next pointer */ if (*mem_head) {