drivers: counter: Fix get_value verification handler

z_vrfy_counter_get_value should check the size of memory pointed to
ticks and not the size of the pointer.

Fixes: #22431
Coverity CID :207984

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2020-03-23 13:50:20 -07:00 committed by Ioannis Glaropoulos
commit 81d96d6e9b

View file

@ -68,7 +68,7 @@ static inline int z_vrfy_counter_get_value(struct device *dev,
u32_t *ticks)
{
Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, get_value));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(ticks, sizeof(ticks)));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks)));
return z_impl_counter_get_value((struct device *)dev, ticks);
}
#include <syscalls/counter_get_value_mrsh.c>