The dev pointer could potentially be NULL here in some P2PS cases, so
check it explicitly before dereferencing it when checking for 6 GHz
capability.
Fixes: b9e2826b9d76 ("P2P: Filter 6 GHz channels if peer doesn't support them")
Signed-off-by: Jouni Malinen <j@w1.fi>
(conncap & (P2PS_SETUP_CLIENT | P2PS_SETUP_GROUP_OWNER))) {
bool is_6ghz_capab;
- is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+ is_6ghz_capab = is_p2p_6ghz_capable(p2p) && dev &&
p2p_is_peer_6ghz_capab(
p2p, dev->info.p2p_device_addr);
p2p_buf_add_channel_list(buf, p2p->cfg->country,