[ 3.5.y.z extended stable ] Patch "xfrm6: release dev before returning error" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Fri May 17 09:16:00 UTC 2013


This is a note to let you know that I have just added a patch titled

    xfrm6: release dev before returning error

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 4a31c6fab79003613839298a4eecaa2206b824f2 Mon Sep 17 00:00:00 2001
From: Cong Wang <amwang at redhat.com>
Date: Thu, 9 May 2013 22:40:00 +0000
Subject: [PATCH] xfrm6: release dev before returning error

commit 84c4a9dfbf430861e7588d95ae3ff61535dca351 upstream.

We forget to call dev_put() on error path in xfrm6_fill_dst(),
its caller doesn't handle this.

Cc: Herbert Xu <herbert at gondor.apana.org.au>
Cc: Steffen Klassert <steffen.klassert at secunet.com>
Cc: David S. Miller <davem at davemloft.net>
Signed-off-by: Cong Wang <amwang at redhat.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 net/ipv6/xfrm6_policy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 8625fba..1cfb9a4 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -96,8 +96,10 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
 	dev_hold(dev);

 	xdst->u.rt6.rt6i_idev = in6_dev_get(dev);
-	if (!xdst->u.rt6.rt6i_idev)
+	if (!xdst->u.rt6.rt6i_idev) {
+		dev_put(dev);
 		return -ENODEV;
+	}

 	xdst->u.rt6.rt6i_peer = rt->rt6i_peer;
 	if (rt->rt6i_peer)
--
1.8.1.2





More information about the kernel-team mailing list