Patchwork ip_gre: remove an extra dst_release()

login
register
mail settings
Submitter Eric Dumazet
Date Feb. 19, 2013, 10:14 p.m.
Message ID <1361312050.19353.169.camel@edumazet-glaptop>
Download mbox | patch
Permalink /patch/221904/
State Accepted
Delegated to: David Miller
Headers show

Comments

Eric Dumazet - Feb. 19, 2013, 10:14 p.m.
From: Eric Dumazet <edumazet@google.com>

commit 68c331631143 (v4 GRE: Add TCP segmentation offload for GRE)
introduced a bug in error path.

dst is attached to skb, so will be released when skb is freed.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Pravin B Shelar <pshelar@nicira.com>
---
 net/ipv4/ip_gre.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pravin B Shelar - Feb. 19, 2013, 10:36 p.m.
On Tue, Feb 19, 2013 at 2:14 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> commit 68c331631143 (v4 GRE: Add TCP segmentation offload for GRE)
> introduced a bug in error path.
>
> dst is attached to skb, so will be released when skb is freed.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Pravin B Shelar <pshelar@nicira.com>

Looks good.

Acked-by: Pravin B Shelar <pshelar@nicira.com>

> ---
>  net/ipv4/ip_gre.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
> index 31bc941..5ef4da7 100644
> --- a/net/ipv4/ip_gre.c
> +++ b/net/ipv4/ip_gre.c
> @@ -1006,10 +1006,8 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
>
>                         if (skb_has_shared_frag(skb)) {
>                                 err = __skb_linearize(skb);
> -                               if (err) {
> -                                       ip_rt_put(rt);
> +                               if (err)
>                                         goto tx_error;
> -                               }
>                         }
>
>                         *ptr = 0;
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Feb. 20, 2013, 3:24 a.m.
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 19 Feb 2013 14:14:10 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> commit 68c331631143 (v4 GRE: Add TCP segmentation offload for GRE)
> introduced a bug in error path.
> 
> dst is attached to skb, so will be released when skb is freed.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 31bc941..5ef4da7 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1006,10 +1006,8 @@  static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
 
 			if (skb_has_shared_frag(skb)) {
 				err = __skb_linearize(skb);
-				if (err) {
-					ip_rt_put(rt);
+				if (err)
 					goto tx_error;
-				}
 			}
 
 			*ptr = 0;