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 <vinayak.kariappa.chettimada@nordicsemi.no>
This commit is contained in:
Vinayak Chettimada 2016-11-16 11:14:27 +01:00 committed by Johan Hedberg
commit e9b818e763

View file

@ -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) {