ath11k: fix uninitialized variable radioup
authorColin Ian King <colin.king@canonical.com>
Thu, 12 Dec 2019 19:10:44 +0000 (19:10 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 18 Dec 2019 17:52:43 +0000 (19:52 +0200)
The variable radioup is not uninitalized so it may contain a garbage
value and hence the detection of a radio that is not up is buggy.
Fix this by initializing it to zero.

Addresses-Coverity: ("Uninitalized scalar variable")
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath11k/debug.c

index e00b5739fb00481e27ec341e593a12bd0dcc9f6f..f48daf17f2d274c1cf0f15d7312335a3e78be269 100644 (file)
@@ -541,7 +541,7 @@ static ssize_t ath11k_write_simulate_fw_crash(struct file *file,
        struct ath11k *ar = ab->pdevs[0].ar;
        char buf[32] = {0};
        ssize_t rc;
-       int i, ret, radioup;
+       int i, ret, radioup = 0;
 
        for (i = 0; i < ab->num_radios; i++) {
                pdev = &ab->pdevs[i];