From: Bob Cantor Date: Thu, 24 Jun 2021 18:14:47 +0000 (+1000) Subject: mac80211: print an error if wifi teardown fails X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc14cfeb4db95f07c6b92cddcc7e3b07e786534a;p=thirdparty%2Fopenwrt.git mac80211: print an error if wifi teardown fails drv_mac80211_teardown fails silently if the device to be torn down is not defined. This commit prints an error message. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor Signed-off-by: maurerr --- diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index ffb3662d04f..0b7a84d7c95 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -1190,6 +1190,10 @@ drv_mac80211_teardown() { json_select data json_get_vars phy json_select .. + [ -n "$phy" ] || { + echo "Bug: PHY is undefined for device '$1'" + return 1 + } mac80211_interface_cleanup "$phy" uci -q -P /var/state revert wireless._${phy}