Search Linux Wireless

[PATCH 2/3] [v2] wifi: ath11k: handle unknown scan state in ath11k_mac_op_remain_on_channel()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In 'ath11k_mac_op_remain_on_channel()', add fallback default to
handle an unknown scan state with -EINVAL. Compile tested only.

Initially found by Linux Verification Center (linuxtesting.org)
with SVACE (and reported as an attempt to use uninitialized
variable).

Suggested-by: Jeff Johnson <quic_jjohnson@xxxxxxxxxxx>
Signed-off-by: Dmitry Antipov <dmantipov@xxxxxxxxx>
---
v2: prefer fallback branch over dummy initializer (Jeff Johnson)
---
 drivers/net/wireless/ath/ath11k/mac.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index a6a37d67a50a..47d3d5fd0423 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -9224,6 +9224,11 @@ static int ath11k_mac_op_remain_on_channel(struct ieee80211_hw *hw,
 	case ATH11K_SCAN_ABORTING:
 		ret = -EBUSY;
 		break;
+	default:
+		ath11k_warn(ar->ab, "%s: unexpected scan state: %d\n",
+			    __func__, ar->scan.state);
+		ret = -EINVAL;
+		break;
 	}
 	spin_unlock_bh(&ar->data_lock);
 
-- 
2.44.0





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux