From b9484852f144676276f2bd5d4361806a9767e7a0 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 22 May 2023 15:06:07 +0200 Subject: [PATCH] drivers/sx126x: fix argument validation in spreading factor The lowest possible value is `LORA_SF5` and not `LORA_SF6`. This fixes the argument validation to allow setting `LORA_SF5` as spreading factor. Fixes https://github.com/RIOT-OS/RIOT/issues/17861 --- drivers/sx126x/sx126x_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sx126x/sx126x_netdev.c b/drivers/sx126x/sx126x_netdev.c index 306a1692a4..d6aaaaa658 100644 --- a/drivers/sx126x/sx126x_netdev.c +++ b/drivers/sx126x/sx126x_netdev.c @@ -401,7 +401,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len) const uint8_t max_sf = sx126x_is_llcc68(dev) ? llcc68_max_sf : sx126x_max_sf; - if ((sf < LORA_SF6) || (sf > max_sf)) { + if ((sf < LORA_SF5) || (sf > max_sf)) { res = -EINVAL; break; }