xfrm6: release dev before returning error
Subsystems (3)
PATCH 1/1 xfrm6: release dev before returning error
From: Cong Wang <[email protected]>
We forget to call dev_put() on error path in xfrm6_fill_dst(), its caller doesn't handle this.
Cc Herbert Xu <[email protected]>
Cc Steffen Klassert <[email protected]>
Cc David S. Miller <[email protected]>
Signed-off-by Cong Wang <[email protected]>
---
net/ipv6/xfrm6_policy.c +3 -1
@@ -103,8 +103,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 ; + }rt6_transfer_peer (&xdst->u.rt6, rt);
David Miller
maintainerFrom: Cong Wang <[email protected]>
Date: Fri, 10 May 2013 16:40:00 +0800
Quoted 9 lines
From: Cong Wang <[email protected]>
We forget to call
dev_put()on error path inxfrm6_fill_dst(), its caller doesn't handle this.Cc Herbert Xu <[email protected]>Cc Steffen Klassert <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Cong Wang <[email protected]>
Applied and queued up for -stable.