projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc01572
)
xfrm: fix error flow in case of add state fails
author
Aviad Yehezkel
<aviadye@mellanox.com>
Thu, 18 Jan 2018 13:41:51 +0000
(15:41 +0200)
committer
Steffen Klassert
<steffen.klassert@secunet.com>
Fri, 19 Jan 2018 05:44:22 +0000
(06:44 +0100)
If add state fails in case of device offload, netdev refcount
will be negative since gc task is attempting to dev_free this state.
This is fixed by putting NULL in state dev field.
Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
Signed-off-by: Boris Pismeny <borisp@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_device.c
patch
|
blob
|
history
diff --git
a/net/xfrm/xfrm_device.c
b/net/xfrm/xfrm_device.c
index 30e5746085b8fcfc5aa8abc7a8a23753c510a630..ac9477189d1cc2e9013af88d549fa075144d4e8c 100644
(file)
--- a/
net/xfrm/xfrm_device.c
+++ b/
net/xfrm/xfrm_device.c
@@
-102,6
+102,7
@@
int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
err = dev->xfrmdev_ops->xdo_dev_state_add(x);
if (err) {
+ xso->dev = NULL;
dev_put(dev);
return err;
}