Skip to contentSkip to conversation

ath6kl: small cleanup in ath6kl_htc_pipe_rx_complete()

PATCH Applied Dan Carpenter 2 participants 2 messages Feb 28, 2013 – Mar 5, 2013

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

PATCH 1/1 ath6kl: small cleanup in ath6kl_htc_pipe_rx_complete()

It's harmless, but Smatch complains if we use "htc_hdr->eid" before doing the bounds check.

drivers/net/wireless/ath/ath6kl/htc_pipe.c +1 -2
index 2813901..9adb567 100644
@@ -988,8 +988,6 @@ static int ath6kl_htc_pipe_rx_complete(struct ath6kl *ar, struct sk_buff *skb,
 
 	htc_hdr = (struct htc_frame_hdr *) netdata;
 
-	ep = &target->endpoint[htc_hdr->eid];
-
 	if (htc_hdr->eid >= ENDPOINT_MAX) {
 		ath6kl_dbg(ATH6KL_DBG_HTC,
 			   "HTC Rx: invalid EndpointID=%d\n",
@@ -997,6 +995,7 @@ static int ath6kl_htc_pipe_rx_complete(struct ath6kl *ar, struct sk_buff *skb,
 		status = -EINVAL;
 		goto free_skb;
 	}
+	ep = &target->endpoint[htc_hdr->eid];
 
 	payload_len = le16_to_cpu(get_unaligned(&htc_hdr->payld_len));
 
Applied
#1 lore raw
Quoted 4 lines · Dan Carpenter

It's harmless, but Smatch complains if we use "htc_hdr->eid" before doing the bounds check.

Thanks, applied.

Signature · 1 line
Kalle Valo