Commit 0571666d authored by Steffen Klassert's avatar Steffen Klassert Committed by Yang Yingliang
Browse files

xfrm: Fix error reporting in xfrm_state_construct.



stable inclusion
from linux-4.19.198
commit b559f417a1aa8715fe040322b1efcb164aea9851

--------------------------------

[ Upstream commit 6fd06963 ]

When memory allocation for XFRMA_ENCAP or XFRMA_COADDR fails,
the error will not be reported because the -ENOMEM assignment
to the err variable is overwritten before. Fix this by moving
these two in front of the function so that memory allocation
failures will be reported.

Reported-by: default avatarTobias Brunner <tobias@strongswan.org>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent fb2ff7dd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment