mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Cc: Steffen Klassert <[email protected]> Cc: David S. Miller <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
5dbd506843
commit
84c4a9dfbf
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue