Skip to contentSkip to conversation

ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point()

PATCH In review Dan Carpenter 2 participants 2 messages Aug 13, 2021 – Aug 29, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point()

This error path is unlikely because of it checked for NULL and returned -ENOMEM earlier in the function. But it should return an error code here as well if we ever do hit it because of a race condition or something.

Fixes bdcd81707973 ("Add ath6kl cleaned up driver")
---
 drivers/net/wireless/ath/ath6kl/wmi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath6kl/wmi.c +3 -1
index b137e7f34397..bd1ef6334997 100644
@@ -2504,8 +2504,10 @@ static int ath6kl_wmi_sync_point(struct wmi *wmi, u8 if_idx)
 		goto free_data_skb;
 
 	for (index = 0; index < num_pri_streams; index++) {
-		if (WARN_ON(!data_sync_bufs[index].skb))
+		if (WARN_ON(!data_sync_bufs[index].skb)) {
+			ret = -ENOMEM;
 			goto free_data_skb;
+		}
 
 		ep_id = ath6kl_ac2_endpoint_id(wmi->parent_dev,
 					       data_sync_bufs[index].
Signature · 1 line
2.20.1
#1 lore raw
Quoted 8 lines · Dan Carpenter

This error path is unlikely because of it checked for NULL and returned -ENOMEM earlier in the function. But it should return an error code here as well if we ever do hit it because of a race condition or something.

Fixes bdcd81707973 ("Add ath6kl cleaned up driver")

Patch applied to ath-next branch of ath.git, thanks.

fd6729ec534c ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point()

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/20210813113438.GB30697@kili/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches