aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorKumar Sanghvi <kumar.sanghvi@stericsson.com>2010-09-27 23:10:42 +0000
committerJonas ABERG <jonas.aberg@stericsson.com>2011-01-24 10:47:53 +0100
commit7ddfc1278f43266b5a485d53c183e3b67c791921 (patch)
tree7352b95d72635d14f7887a8a76233210f6c2ecd6 /net
parent100478ed98a79a0c4cd3960b2e816a9829b0d389 (diff)
Phonet: Correct header retrieval after pskb_may_pull
Retrieve the header after doing pskb_may_pull since, pskb_may_pull could change the buffer structure. This is based on the comment given by Eric Dumazet on Phonet Pipe controller patch for a similar problem. Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: RĂ©mi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I3a3ddfc9ff227c0febdad7ae7e129ce4861861e1 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13158 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'net')
-rw-r--r--net/phonet/pep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 5ddf0487a68..7c65631682b 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -507,12 +507,13 @@ static void pipe_grant_credits(struct sock *sk)
static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb)
{
struct pep_sock *pn = pep_sk(sk);
- struct pnpipehdr *hdr = pnp_hdr(skb);
+ struct pnpipehdr *hdr;
int wake = 0;
if (!pskb_may_pull(skb, sizeof(*hdr) + 4))
return -EINVAL;
+ hdr = pnp_hdr(skb);
if (hdr->data[0] != PN_PEP_TYPE_COMMON) {
LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n",
(unsigned)hdr->data[0]);