Skip to content
Commit a45a9e8a authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by David S. Miller
Browse files

atm: eni: avoid accessing the data mapped to streaming DMA



In do_tx(), skb->data is mapped to streaming DMA on line 1111:
  paddr = dma_map_single(...,skb->data,DMA_TO_DEVICE);

Then skb->data is accessed on line 1153:
  (skb->data[3] & 0xf)

This access may cause data inconsistency between CPU cache and hardware.

To fix this problem, skb->data[3] is assigned to a local variable before
DMA mapping, and then the driver accesses this local variable instead of
skb->data[3].

Signed-off-by: default avatarJia-Ju Bai <baijiaju@tsinghua.edu.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6d78e473
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment