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 <leonro@nvidia.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent 94b95df commit ec8f32a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)