summary refs log tree commit diff
path: root/drivers
diff options
context:
space:
mode:
authorHarshitha Prem <quic_hprem@quicinc.com>2023-04-04 00:11:55 +0530
committerPierre-Loup A. Griffais <pgriffais@valvesoftware.com>2023-11-02 16:07:58 -0700
commitaa466088dcde6eada3be00c4b7dd01826d8a548e (patch)
tree8c19cef1d5f6e6f5300e723685b7fe7bf5ec3195 /drivers
parent2e06fb76b200dfa04b5c3b00431832111a5d2ff0 (diff)
downloadlinux-aa466088dcde6eada3be00c4b7dd01826d8a548e.tar.gz
wifi: ath11k: fix undefined behavior with __fls in dp
"__fls" would have an undefined behavior if the argument is passed
as "0". Hence, added changes to handle the same.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Signed-off-by: Nagarajan Maran <quic_nmaran@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230403184155.8670-3-quic_nmaran@quicinc.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath11k/dp_rx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 38be646bc021..0a2e575cd232 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -3609,7 +3609,7 @@ static int ath11k_dp_rx_frag_h_mpdu(struct ath11k *ar,
 		goto out_unlock;
 	}
 
-	if (frag_no > __fls(rx_tid->rx_frag_bitmap))
+	if (!rx_tid->rx_frag_bitmap || (frag_no > __fls(rx_tid->rx_frag_bitmap)))
 		__skb_queue_tail(&rx_tid->rx_frags, msdu);
 	else
 		ath11k_dp_rx_h_sort_frags(ar, &rx_tid->rx_frags, msdu);