]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfrm: don't skip free of empty state in acquire policy
authorLeon Romanovsky <leonro@nvidia.com>
Mon, 31 Jul 2023 11:38:27 +0000 (14:38 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Aug 2023 15:32:43 +0000 (17:32 +0200)
commitc8ce01aad133b52b0623929e30a999f49a7f2e8b
treedcb2de07806ae2731dde21d979b68afcc967df24
parent757eaa5d7625b1cbdcb6b34a25a635a6c6676e72
xfrm: don't skip free of empty state in acquire policy

[ Upstream commit f3ec2b5d879ef5bbcb24678914641343cb6399a2 ]

In destruction flow, the assignment of NULL to xso->dev
caused to skip of xfrm_dev_state_free() call, which was
called in xfrm_state_put(to_put) routine.

Instead of open-coded variant of xfrm_dev_state_delete() and
xfrm_dev_state_free(), let's use them directly.

Fixes: f8a70afafc17 ("xfrm: add TX datapath support for IPsec packet offload mode")
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>
include/net/xfrm.h
net/xfrm/xfrm_state.c