mirror of https://gitee.com/openkylin/linux.git
ath6kl: Fix random rx data corruption
The skb->tail pointer of rx buffers is not adjusted after skb->data pointer is aligned to 4-byte, this causes random rx data corruption. Signed-off-by: Jin Navy <nhjin@qca.qualcomm.com> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
parent
363f149ce3
commit
baec5c6d0b
|
@ -894,8 +894,11 @@ void ath6kl_rx_refill(struct htc_target *target, enum htc_endpoint_id endpoint)
|
|||
break;
|
||||
|
||||
packet = (struct htc_packet *) skb->head;
|
||||
if (!IS_ALIGNED((unsigned long) skb->data, 4))
|
||||
if (!IS_ALIGNED((unsigned long) skb->data, 4)) {
|
||||
size_t len = skb_headlen(skb);
|
||||
skb->data = PTR_ALIGN(skb->data - 4, 4);
|
||||
skb_set_tail_pointer(skb, len);
|
||||
}
|
||||
set_htc_rxpkt_info(packet, skb, skb->data,
|
||||
ATH6KL_BUFFER_SIZE, endpoint);
|
||||
packet->skb = skb;
|
||||
|
@ -917,8 +920,11 @@ void ath6kl_refill_amsdu_rxbufs(struct ath6kl *ar, int count)
|
|||
return;
|
||||
|
||||
packet = (struct htc_packet *) skb->head;
|
||||
if (!IS_ALIGNED((unsigned long) skb->data, 4))
|
||||
if (!IS_ALIGNED((unsigned long) skb->data, 4)) {
|
||||
size_t len = skb_headlen(skb);
|
||||
skb->data = PTR_ALIGN(skb->data - 4, 4);
|
||||
skb_set_tail_pointer(skb, len);
|
||||
}
|
||||
set_htc_rxpkt_info(packet, skb, skb->data,
|
||||
ATH6KL_AMSDU_BUFFER_SIZE, 0);
|
||||
packet->skb = skb;
|
||||
|
|
Loading…
Reference in New Issue