mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
xfrm6: release dev before returning error
[ Upstream commit 84c4a9dfbf
]
We forget to call dev_put() on error path in xfrm6_fill_dst(),
its caller doesn't handle this.
Signed-off-by: Cong Wang <amwang@redhat.com>
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: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7d9577d0b2
commit
a98124aac0
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue