All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] ath6kl: small cleanup in ath6kl_htc_pipe_rx_complete()
@ 2013-02-28  4:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-02-28  4:45 UTC (permalink / raw)
  To: Kalle Valo; +Cc: John W. Linville, linux-wireless, kernel-janitors

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
index 2813901..9adb567 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
@@ -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));
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] ath6kl: small cleanup in ath6kl_htc_pipe_rx_complete()
@ 2013-02-28  4:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-02-28  4:45 UTC (permalink / raw)
  To: Kalle Valo; +Cc: John W. Linville, linux-wireless, kernel-janitors

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
index 2813901..9adb567 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
@@ -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));
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] ath6kl: small cleanup in ath6kl_htc_pipe_rx_complete()
  2013-02-28  4:45 ` Dan Carpenter
@ 2013-03-05  7:53   ` Kalle Valo
  -1 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2013-03-05  7:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: John W. Linville, linux-wireless, kernel-janitors, ath6kl-devel

Dan Carpenter <dan.carpenter@oracle.com> writes:

> It's harmless, but Smatch complains if we use "htc_hdr->eid" before
> doing the bounds check.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] ath6kl: small cleanup in ath6kl_htc_pipe_rx_complete()
@ 2013-03-05  7:53   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2013-03-05  7:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: John W. Linville, linux-wireless, kernel-janitors, ath6kl-devel

Dan Carpenter <dan.carpenter@oracle.com> writes:

> It's harmless, but Smatch complains if we use "htc_hdr->eid" before
> doing the bounds check.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-05  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28  4:45 [patch] ath6kl: small cleanup in ath6kl_htc_pipe_rx_complete() Dan Carpenter
2013-02-28  4:45 ` Dan Carpenter
2013-03-05  7:53 ` Kalle Valo
2013-03-05  7:53   ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.