ath11k: ensure ts.flags is initialized before bit-wise or'ing in values
authorColin Ian King <colin.king@canonical.com>
Sat, 21 Dec 2019 00:40:46 +0000 (00:40 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Sun, 26 Jan 2020 10:45:08 +0000 (12:45 +0200)
Currently the structure ts is not inititalized and ts.flags contains
garbage values from the stack.  This is being passed into function
ath11k_dp_tx_status_parse that bit-wise or'ing in settings into the
ts.flags field.  To avoid flags (and other fields) from containing
garbage, initialize the structure to zero before use.

Addresses-Coverity: ("Uninitialized 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/dp_tx.c

index 918305dda1061c66c0d93b9a24578a5fc4a158a8..04ad1a20e4591211ea89e0efea0de50d35c1ac50 100644 (file)
@@ -461,7 +461,7 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
        int hal_ring_id = dp->tx_ring[ring_id].tcl_comp_ring.ring_id;
        struct hal_srng *status_ring = &ab->hal.srng_list[hal_ring_id];
        struct sk_buff *msdu;
-       struct hal_tx_status ts;
+       struct hal_tx_status ts = { 0 };
        struct dp_tx_ring *tx_ring = &dp->tx_ring[ring_id];
        u32 *desc;
        u32 msdu_id;