Skip to content

Commit 67a6338

Browse files
committed
xfrm: Fix negative device refcount on offload failure.
Reset the offload device at the xfrm_state if the device was not able to offload the state. Otherwise we drop the device refcount twice. Fixes: d77e38e ("xfrm: Add an IPsec hardware offloading API") Reported-by: Shannon Nelson <shannon.nelson@oracle.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent c5d4d7d commit 67a6338

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/xfrm/xfrm_device.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
9191
}
9292

9393
if (!dev->xfrmdev_ops || !dev->xfrmdev_ops->xdo_dev_state_add) {
94+
xso->dev = NULL;
9495
dev_put(dev);
9596
return 0;
9697
}

0 commit comments

Comments
 (0)