Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Kumar A Sanghvi <kumar.sanghvi@stericsson.com>
Cc: remi.denis-courmont@nokia.com, davem@davemloft.net,
	netdev@vger.kernel.org, STEricsson_nomadik_linux@list.st.com,
	sudeep.divakaran@stericsson.com, gulshan.karmani@stericsson.com,
	Linus Walleij <linus.walleij@stericsson.com>
Subject: Re: [PATCH 1/2] Phonet: Implement Pipe Controller to support Nokia Slim Modems
Date: Fri, 24 Sep 2010 15:52:13 +0200	[thread overview]
Message-ID: <1285336333.2503.153.camel@edumazet-laptop> (raw)
In-Reply-To: <1285330996-27076-2-git-send-email-kumar.sanghvi@stericsson.com>

Le vendredi 24 septembre 2010 à 17:53 +0530, Kumar A Sanghvi a écrit :

> +static int pipe_get_flow_info(struct sock *sk, struct sk_buff *skb,
> +		u8 *pref_rx_fc, u8 *req_tx_fc)
> +{
> +	struct pnpipehdr *hdr = pnp_hdr(skb);
> +	u8 n_sb;
> +
> +	if (!pskb_may_pull(skb, sizeof(*hdr) + 4))
> +		return -EINVAL;

This is wrong.

pskb_may_pull() might change skb->data, so you should do

{
	struct pnpipehdr *hdr;
	u8 n_sb;

	if (!pskb_may_pull(skb, sizeof(*hdr) + 4))
		return -EINVAL;

	hdr = pnp_hdr(skb);

...






  reply	other threads:[~2010-09-24 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24 12:23 [PATCH 0/2] Phonet: Implement Pipe Controller to support Nokia Slim Modems Kumar A Sanghvi
2010-09-24 12:23 ` [PATCH 1/2] " Kumar A Sanghvi
2010-09-24 13:52   ` Eric Dumazet [this message]
2010-09-24 14:20     ` Kumar SANGHVI
2010-09-24 12:23 ` [PATCH 2/2] Documentation: Update Phonet doc for Pipe Controller implementation Kumar A Sanghvi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285336333.2503.153.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=STEricsson_nomadik_linux@list.st.com \
    --cc=davem@davemloft.net \
    --cc=gulshan.karmani@stericsson.com \
    --cc=kumar.sanghvi@stericsson.com \
    --cc=linus.walleij@stericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=remi.denis-courmont@nokia.com \
    --cc=sudeep.divakaran@stericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox