From e1ee34e55cf81c2d7cb3d9a53ad8d495d72f132e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 2 Aug 2022 17:10:34 +0100 Subject: [PATCH] drivers: sensor: sm351lt: Fix global thread triggering bug This fixes a bug in the sm351lt driver whereby global triggering will cause an MPU fault due to an unset pointer. Signed-off-by: Jamie McCrae --- drivers/sensor/sm351lt/sm351lt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sensor/sm351lt/sm351lt.c b/drivers/sensor/sm351lt/sm351lt.c index eeb04781673..e52b3c885cd 100644 --- a/drivers/sensor/sm351lt/sm351lt.c +++ b/drivers/sensor/sm351lt/sm351lt.c @@ -209,9 +209,9 @@ static int sm351lt_init(const struct device *dev) } #if defined(CONFIG_SM351LT_TRIGGER) -#if defined(CONFIG_SM351LT_TRIGGER_OWN_THREAD) data->dev = dev; +#if defined(CONFIG_SM351LT_TRIGGER_OWN_THREAD) k_sem_init(&data->gpio_sem, 0, K_SEM_MAX_LIMIT); k_thread_create(&data->thread, data->thread_stack,