mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-13 12:49:35 +02:00
xfrm: fix netdev reference count imbalance
[ Upstream commit9199b915e9
] In cited commit, netdev_tracker_alloc() is called for the newly allocated xfrm state, but dev_hold() is missed, which causes netdev reference count imbalance, because netdev_put() is called when the state is freed in xfrm_dev_state_free(). Fix the issue by replacing netdev_tracker_alloc() with netdev_hold(). Fixes:f8a70afafc
("xfrm: add TX datapath support for IPsec packet offload mode") Signed-off-by: Jianbo Liu <jianbol@nvidia.com> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7a0edc3d83
commit
0c92f09017
|
@ -1331,8 +1331,7 @@ found:
|
||||||
xso->dev = xdo->dev;
|
xso->dev = xdo->dev;
|
||||||
xso->real_dev = xdo->real_dev;
|
xso->real_dev = xdo->real_dev;
|
||||||
xso->flags = XFRM_DEV_OFFLOAD_FLAG_ACQ;
|
xso->flags = XFRM_DEV_OFFLOAD_FLAG_ACQ;
|
||||||
netdev_tracker_alloc(xso->dev, &xso->dev_tracker,
|
netdev_hold(xso->dev, &xso->dev_tracker, GFP_ATOMIC);
|
||||||
GFP_ATOMIC);
|
|
||||||
error = xso->dev->xfrmdev_ops->xdo_dev_state_add(x, NULL);
|
error = xso->dev->xfrmdev_ops->xdo_dev_state_add(x, NULL);
|
||||||
if (error) {
|
if (error) {
|
||||||
xso->dir = 0;
|
xso->dir = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user