[PATCH 2/2] src/station.c: fix of SEGV in station_roam_scan_notify when performing repeated roam scan at legacy roaming after ft_auth-/ft_reassoc-timeout when using mwifiex / NXP 88W9098 driver

Dierk Modrow <[email protected]> Mon, 13 Jul 2026 13:22:42 +0200
Newsgroups dev.linux.lists.iwd
Message-ID <[email protected]>
From: DEMODDIE <[email protected]>

---
 src/station.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/station.c b/src/station.c
index 8fcf8c70..077e510e 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2253,7 +2253,7 @@ static bool station_can_fast_transition(struct statio=
n *station,
 {
        uint16_t mdid;

-       if (!hs->mde)
+       if (!hs || !hs->mde)
                return false;

        if (ie_parse_mobility_domain_from_data(hs->mde, hs->mde[1] + 2,
@@ -2917,7 +2917,7 @@ static bool station_roam_scan_notify(int err, struct =
l_queue *bss_list,

        orig_security =3D network_get_security(network);

-       if (hs->mde)
+       if (hs && hs->mde)
                ie_parse_mobility_domain_from_data(hs->mde, hs->mde[1] + 2,
                                                        &mdid, NULL, NULL);

@@ -2930,7 +2930,7 @@ static bool station_roam_scan_notify(int err, struct =
l_queue *bss_list,
        if (bss && !station->ap_directed_roaming) {
                double cur_bss_rank =3D bss->rank;

-               if (hs->mde && bss->mde_present && l_get_le16(bss->mde) =3D=
=3D mdid)
+               if (hs && hs->mde && bss->mde_present && l_get_le16(bss->md=
e) =3D=3D mdid)
                        cur_bss_rank *=3D RANK_FT_FACTOR;

                cur_bss_group_rank =3D evaluate_bss_group_rank(bss->addr,
@@ -2967,8 +2967,8 @@ static bool station_roam_scan_notify(int err, struct =
l_queue *bss_list,
                        goto next;

                /* Skip result if it is not part of the ESS */
-               if (bss->ssid_len !=3D hs->ssid_len ||
-                               memcmp(bss->ssid, hs->ssid, hs->ssid_len))
+               if (hs && (bss->ssid_len !=3D hs->ssid_len ||
+                               memcmp(bss->ssid, hs->ssid, hs->ssid_len)))
                        goto next;

                if (scan_bss_get_security(bss, &security) < 0)
@@ -2986,7 +2986,7 @@ static bool station_roam_scan_notify(int err, struct =
l_queue *bss_list,

                rank =3D bss->rank;

-               if (hs->mde && bss->mde_present && l_get_le16(bss->mde) =3D=
=3D mdid)
+               if (hs && hs->mde && bss->mde_present && l_get_le16(bss->md=
e) =3D=3D mdid)
                        rank *=3D RANK_FT_FACTOR;

                group_rank =3D evaluate_bss_group_rank(bss->addr, bss->freq=
uency,
--
2.53.0.windows.2


________________________________


SEW-EURODRIVE GmbH & Co KG
Kommanditgesellschaft, Sitz: Bruchsal, RG Mannheim HRA 230970
Komplement=E4rin: SEW-EURODRIVE Verwaltungs-GmbH, Sitz: Bruchsal, RG Mannhe=
im HRB 230207

Gesch=E4ftsf=FChrender Gesellschafter: J=FCrgen Blickle
Gesch=E4ftsf=FChrung: J=FCrgen Blickle (Vorsitzender), Dr. J=F6rg Hermes, D=
r. Hans Krattenmacher, Michael Luz, Christian Mayer, Dr. Markus W=F6pperman=
n