aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Cantor <coxede6557@w3boats.com>2021-06-25 04:14:47 +1000
committerFelix Fietkau <nbd@nbd.name>2021-06-30 19:24:55 +0200
commit6f13a390355d15bc1ecff59eba769d0189d05083 (patch)
treebc3cee6ef6bf631e313a0a92157920e9160dd5f1
parent9302e63d1a3589f764e61caf0b3ecdad524458ea (diff)
downloadupstream-6f13a390355d15bc1ecff59eba769d0189d05083.tar.gz
upstream-6f13a390355d15bc1ecff59eba769d0189d05083.tar.bz2
upstream-6f13a390355d15bc1ecff59eba769d0189d05083.zip
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 <coxede6557@w3boats.com> (cherry-picked from commit 3933e29d1b87c713167cf4730b68e5f18af4f140)
-rw-r--r--package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index e3b26b287c..9a9c35fb5f 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -1076,6 +1076,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}