From c86225384a12589a7fff5c8ccd6f47f24b13ca10 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 21:42:53 +0530 Subject: [PATCH] drivers: nrfwifi: Add a NULL check for FMAC context In case the driver UP fails, the FMAC context will be NULL, so, add a NULL check in the DOWN. Fixes a crash seen when working with unprogrammed OTP (no MAC) that fails the interface UP. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrfwifi/src/net_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/wifi/nrfwifi/src/net_if.c b/drivers/wifi/nrfwifi/src/net_if.c index a4404cfb1a7a11..1a8b0c7361af4c 100644 --- a/drivers/wifi/nrfwifi/src/net_if.c +++ b/drivers/wifi/nrfwifi/src/net_if.c @@ -877,7 +877,7 @@ int nrf_wifi_if_stop_zep(const struct device *dev) } rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - if (!rpu_ctx_zep) { + if (!rpu_ctx_zep || !rpu_ctx_zep->rpu_ctx) { LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); goto unlock;