From 7c6eaae98dec50801e2210cfaa4d1360a1bd1f95 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Tue, 21 May 2024 15:35:03 +0000 Subject: [PATCH] drivers: sensor: nxp: kinetis: temp: fix memset() length Use the correct buffer size when calling memset(). Fixes: #73093 Signed-off-by: Henrik Brix Andersen (cherry picked from commit 59402fd82ef07634e580b2e85f600b2f4897235a) --- drivers/sensor/nxp_kinetis_temp/temp_kinetis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sensor/nxp_kinetis_temp/temp_kinetis.c b/drivers/sensor/nxp_kinetis_temp/temp_kinetis.c index b8d9915d331692..950dea3ea82ffc 100644 --- a/drivers/sensor/nxp_kinetis_temp/temp_kinetis.c +++ b/drivers/sensor/nxp_kinetis_temp/temp_kinetis.c @@ -159,7 +159,7 @@ static int temp_kinetis_init(const struct device *dev) }, }; - memset(&data->buffer, 0, ARRAY_SIZE(data->buffer)); + memset(&data->buffer, 0, sizeof(data->buffer)); if (!device_is_ready(config->adc)) { LOG_ERR("ADC device is not ready");