Pointer 'msg' from nl80211_bss_msg() might be NULL and might be
dereferenced by nla_put_u8(), so need to check for memory allocation
failure explicitly here.
Fixes: b1e463374e ("AP MLD: Link-specific flushing of stations")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
* XXX: FIX! this needs to flush all VLANs too
*/
msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_STATION);
+ if (!msg)
+ goto fail;
if (link_id >= 0 && (bss->valid_links & BIT(link_id)) &&
nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id))
goto fail;