Skip to content

Commit 1fc4a3e

Browse files
committed
wifi: mac80211: mesh: check element parsing succeeded
ieee802_11_parse_elems() can return NULL, so we must check for the return value. Fixes: 5d24828 ("mac80211: always allocate struct ieee802_11_elems") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20231211085121.93dea364f3d3.Ie87781c6c48979fb25a744b90af4a33dc2d83a28@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 98849ba commit 1fc4a3e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/mac80211/mesh_plink.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata,
12471247
return;
12481248
}
12491249
elems = ieee802_11_parse_elems(baseaddr, len - baselen, true, NULL);
1250-
mesh_process_plink_frame(sdata, mgmt, elems, rx_status);
1251-
kfree(elems);
1250+
if (elems) {
1251+
mesh_process_plink_frame(sdata, mgmt, elems, rx_status);
1252+
kfree(elems);
1253+
}
12521254
}

0 commit comments

Comments
 (0)