Commit cb9b68d7 authored by François Romieu's avatar François Romieu Committed by Jeff Garzik

[PATCH] r8169: skb alignment nitpicking

Nail an overrun in skb alignment and remove the relevant magic variable.
Signed-off-by: default avatarJon Mason <jdmason@us.ibm.com>
Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 2cf73b87
...@@ -1697,11 +1697,11 @@ static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, ...@@ -1697,11 +1697,11 @@ static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff,
dma_addr_t mapping; dma_addr_t mapping;
int ret = 0; int ret = 0;
skb = dev_alloc_skb(rx_buf_sz); skb = dev_alloc_skb(rx_buf_sz + NET_IP_ALIGN);
if (!skb) if (!skb)
goto err_out; goto err_out;
skb_reserve(skb, 2); skb_reserve(skb, NET_IP_ALIGN);
*sk_buff = skb; *sk_buff = skb;
mapping = pci_map_single(pdev, skb->tail, rx_buf_sz, mapping = pci_map_single(pdev, skb->tail, rx_buf_sz,
...@@ -2140,9 +2140,9 @@ static inline int rtl8169_try_rx_copy(struct sk_buff **sk_buff, int pkt_size, ...@@ -2140,9 +2140,9 @@ static inline int rtl8169_try_rx_copy(struct sk_buff **sk_buff, int pkt_size,
if (pkt_size < rx_copybreak) { if (pkt_size < rx_copybreak) {
struct sk_buff *skb; struct sk_buff *skb;
skb = dev_alloc_skb(pkt_size + 2); skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN);
if (skb) { if (skb) {
skb_reserve(skb, 2); skb_reserve(skb, NET_IP_ALIGN);
eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0); eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0);
*sk_buff = skb; *sk_buff = skb;
rtl8169_return_to_asic(desc, rx_buf_sz); rtl8169_return_to_asic(desc, rx_buf_sz);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment