Skip to content

Commit 9d3992b

Browse files
committed
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: ChenTao.BSH <[email protected]>
1 parent f77e258 commit 9d3992b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/l2/wifi/wifi_mgmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static const struct wifi_mgmt_ops *const get_wifi_api(struct net_if *iface)
356356
const struct device *dev = net_if_get_device(iface);
357357
struct net_wifi_mgmt_offload *off_api;
358358

359-
if (dev == NULL) {
359+
if (dev == NULL || !net_if_is_wifi(iface)) {
360360
return NULL;
361361
}
362362

0 commit comments

Comments
 (0)