diff options
author | Cong Wang <amwang@redhat.com> | 2013-05-09 18:40:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-11 20:40:15 -0400 |
commit | 84c4a9dfbf430861e7588d95ae3ff61535dca351 (patch) | |
tree | 1fce44619878ee08fa6ddef23d8fcd4f84e95ba5 /net | |
parent | 5dbd5068430b8bd1c19387d46d6c1a88b261257f (diff) |
xfrm6: release dev before returning error
We forget to call dev_put() on error path in xfrm6_fill_dst(),
its caller doesn't handle this.
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 4ef7bdb65440..23ed03d786c8 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -103,8 +103,10 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, | |||
103 | dev_hold(dev); | 103 | dev_hold(dev); |
104 | 104 | ||
105 | xdst->u.rt6.rt6i_idev = in6_dev_get(dev); | 105 | xdst->u.rt6.rt6i_idev = in6_dev_get(dev); |
106 | if (!xdst->u.rt6.rt6i_idev) | 106 | if (!xdst->u.rt6.rt6i_idev) { |
107 | dev_put(dev); | ||
107 | return -ENODEV; | 108 | return -ENODEV; |
109 | } | ||
108 | 110 | ||
109 | rt6_transfer_peer(&xdst->u.rt6, rt); | 111 | rt6_transfer_peer(&xdst->u.rt6, rt); |
110 | 112 | ||