diff options
| author | Bob Cantor | 2021-06-24 18:14:47 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2021-06-28 15:24:11 +0000 |
| commit | 3933e29d1b87c713167cf4730b68e5f18af4f140 (patch) | |
| tree | c28d2b3352de8a44a2fda3712bda506350a32dcd | |
| parent | d515f6b6cde357bf480d32a7387f07ea40e85e52 (diff) | |
| download | openwrt-3933e29d1b87c713167cf4730b68e5f18af4f140.tar.gz | |
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>
| -rw-r--r-- | package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 4 |
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 ffb3662d04..0b7a84d7c9 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} |