Skip to content

Commit ec8f32a

Browse files
rleonklassert
authored andcommitted
xfrm: Fix leak of dev tracker
At the stage of direction checks, the netdev reference tracker is already initialized, but released with wrong *_put() call. Fixes: 919e43f ("xfrm: add an interface to offload policy") Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 94b95df commit ec8f32a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/xfrm/xfrm_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ int xfrm_dev_policy_add(struct net *net, struct xfrm_policy *xp,
378378
break;
379379
default:
380380
xdo->dev = NULL;
381-
dev_put(dev);
381+
netdev_put(dev, &xdo->dev_tracker);
382382
NL_SET_ERR_MSG(extack, "Unrecognized offload direction");
383383
return -EINVAL;
384384
}

0 commit comments

Comments
 (0)