From 755280a4cc1e258516685319c220093debf063d6 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Mon, 18 Aug 2025 07:30:38 -0700 Subject: [PATCH] netdev: check connected in channel switch event In an ideal world userspace should never be getting a channel switch event unless connected to an AP, but alas this has been seen at least with ath10k hardware. This causes IWD to crash since the logic assumes netdev->handshake is set. --- src/netdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/netdev.c b/src/netdev.c index c5ab9105..8a9dac84 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -5417,6 +5417,9 @@ static void netdev_channel_switch_event(struct l_genl_msg *msg, if (netdev->type != NL80211_IFTYPE_STATION) return; + if (L_WARN_ON(!netdev->connected)) + return; + chandef = l_new(struct band_chandef, 1); if (nl80211_parse_chandef(msg, chandef) < 0) {