All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Rémi Denis-Courmont" <remi@remlab.net>
Cc: netdev@vger.kernel.org,
	"Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
Subject: Re: [PATCH] Phonet: hold socket before giving it to sk_deliver_skb()
Date: Thu, 15 Oct 2009 16:52:19 +0200	[thread overview]
Message-ID: <4AD73723.80604@gmail.com> (raw)
In-Reply-To: <1255611600-18534-1-git-send-email-remi@remlab.net>

Rémi Denis-Courmont a écrit :
> From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
> 
> Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
> ---
>  net/phonet/socket.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/net/phonet/socket.c b/net/phonet/socket.c
> index 8c84190..0412beb 100644
> --- a/net/phonet/socket.c
> +++ b/net/phonet/socket.c
> @@ -112,8 +112,10 @@ void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb)
>  			continue;
>  
>  		clone = skb_clone(skb, GFP_ATOMIC);
> -		if (clone)
> +		if (clone) {
> +			sock_hold(sknode);
>  			sk_receive_skb(sknode, clone, 0);
> +		}
>  	}
>  	spin_unlock(&pnsocks.lock);
>  }

Indeed sk_receive_skb() does a sock_put(sk)

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

  reply	other threads:[~2009-10-15 14:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14 10:47 [PATCH net-next 0/5] Phonet: basic routing support Rémi Denis-Courmont
2009-10-14 10:48 ` [PATCH 1/5] Phonet: deliver broadcast packets to broadcast sockets Rémi Denis-Courmont
2009-10-14 10:48   ` [PATCH 2/5] Phonet: routing table backend Rémi Denis-Courmont
2009-10-14 10:48     ` [PATCH 3/5] Phonet: routing table Netlink interface Rémi Denis-Courmont
2009-10-14 10:48       ` [PATCH 4/5] Phonet: route outgoing packets Rémi Denis-Courmont
2009-10-14 10:48         ` [PATCH 5/5] Phonet: forward incoming packets Rémi Denis-Courmont
2009-10-14 22:08 ` [PATCH net-next 0/5] Phonet: basic routing support David Miller
2009-10-15 12:58   ` Rémi Denis-Courmont
2009-10-15 13:00     ` [PATCH] Phonet: hold socket before giving it to sk_deliver_skb() Rémi Denis-Courmont
2009-10-15 14:52       ` Eric Dumazet [this message]
2009-10-15 19:29       ` David Miller

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=4AD73723.80604@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=remi.denis-courmont@nokia.com \
    --cc=remi@remlab.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.