Skip to content

Commit

Permalink
[PATCH] skge: use dev_alloc_skb
Browse files Browse the repository at this point in the history
To avoid problems with buggy protocols that assume extra header space,
use dev_alloc_skb() when allocating receive buffers.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Aug 29, 2006
1 parent 78bc218 commit 83c758f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,8 @@ static int skge_rx_fill(struct skge_port *skge)
do {
struct sk_buff *skb;

skb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_KERNEL);
skb = __dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN,
GFP_KERNEL);
if (!skb)
return -ENOMEM;

Expand Down Expand Up @@ -2609,7 +2610,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
goto error;

if (len < RX_COPY_THRESHOLD) {
skb = alloc_skb(len + 2, GFP_ATOMIC);
skb = dev_alloc_skb(len + 2);
if (!skb)
goto resubmit;

Expand All @@ -2624,7 +2625,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
skge_rx_reuse(e, skge->rx_buf_size);
} else {
struct sk_buff *nskb;
nskb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_ATOMIC);
nskb = dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN);
if (!nskb)
goto resubmit;

Expand Down

0 comments on commit 83c758f

Please sign in to comment.