From: Kalle Valo Date: Tue, 30 Apr 2013 17:28:52 +0300 Subject: [ath9k-devel] [PATCH 06/27] ath10k: fix long lines in htc.c In-Reply-To: <20130430142240.24217.41973.stgit@localhost6.localdomain6> References: <20130430142240.24217.41973.stgit@localhost6.localdomain6> Message-ID: <20130430142852.24217.26517.stgit@localhost6.localdomain6> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/htc.c | 5 ++++- drivers/net/wireless/ath/ath10k/htt_rx.c | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index a12c05b..ede91bd 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -479,6 +479,7 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar, struct ath10k_htc_ep *ep; u16 payload_len; u32 trailer_len = 0; + size_t min_len; u8 eid; bool trailer_present; @@ -533,7 +534,9 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar, u8 *trailer; trailer_len = hdr->trailer_len; - if ((trailer_len < sizeof(struct ath10k_ath10k_htc_record_hdr)) || + min_len = sizeof(struct ath10k_ath10k_htc_record_hdr); + + if ((trailer_len < min_len) || (trailer_len > payload_len)) { ath10k_warn("Invalid trailer length: %d\n", trailer_len); diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 23399d1..ed61dd3 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -104,6 +104,7 @@ static int ath10k_htt_rx_ring_fill_level(struct ath10k_htt *htt) static void ath10k_htt_rx_ring_fill_n(struct ath10k_htt *htt, int num) { struct htt_rx_desc *rx_desc; + unsigned long timeout; struct sk_buff *skb; dma_addr_t paddr; int idx; @@ -120,8 +121,10 @@ static void ath10k_htt_rx_ring_fill_n(struct ath10k_htt *htt, int num) * As long as enough buffers are left in the ring for * another A-MPDU rx, no special recovery is needed. */ - mod_timer(&htt->rx_ring.refill_retry_timer, jiffies + - msecs_to_jiffies(HTT_RX_RING_REFILL_RETRY_MS)); + timeout = jiffies + + msecs_to_jiffies(HTT_RX_RING_REFILL_RETRY_MS); + mod_timer(&htt->rx_ring.refill_retry_timer, + timeout); goto fail; }