Skip to content

Commit

Permalink
[PPP] pppoe: Fix skb_unshare_check call position
Browse files Browse the repository at this point in the history
The skb_unshare_check call needs to be made before pskb_may_pull,
not after.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Sep 16, 2007
1 parent 559cf71 commit 31bac44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/pppoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,12 @@ static int pppoe_rcv(struct sk_buff *skb,
struct pppoe_hdr *ph;
struct pppox_sock *po;

if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
goto drop;

if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
goto out;

if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
goto drop;

ph = pppoe_hdr(skb);

po = get_item((unsigned long) ph->sid, eth_hdr(skb)->h_source, dev->ifindex);
Expand Down

0 comments on commit 31bac44

Please sign in to comment.