Browse Source

net: wifi: fix the bug by non-wifi network call

Added network type check to fix the system crash caused by non-wifi
network card calling wifi api interface

Company:BSH Crop
Signed-off-by: Chen Tao <ct05342@163.com>
pull/90656/head
Chen Tao 2 months ago committed by Benjamin Cabé
parent
commit
b513e08271
  1. 2
      subsys/net/l2/wifi/wifi_mgmt.c

2
subsys/net/l2/wifi/wifi_mgmt.c

@ -356,7 +356,7 @@ static const struct wifi_mgmt_ops *const get_wifi_api(struct net_if *iface) @@ -356,7 +356,7 @@ static const struct wifi_mgmt_ops *const get_wifi_api(struct net_if *iface)
const struct device *dev = net_if_get_device(iface);
struct net_wifi_mgmt_offload *off_api;
if (dev == NULL) {
if (dev == NULL || !net_if_is_wifi(iface)) {
return NULL;
}

Loading…
Cancel
Save