chtls: Fix potential resource leak
authorPan Bian <bianpan2016@163.com>
Thu, 21 Jan 2021 14:57:38 +0000 (06:57 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Feb 2021 12:55:05 +0000 (13:55 +0100)
commit8007199fe372a7de7a3bc4dc0dca364f2129923a
tree6bb34cad744beb6c3b5b3fadd41ddb5e88f6a2d6
parent439ac48a33c5d2bc0103b1f6a867d64ce0f54868
chtls: Fix potential resource leak

[ Upstream commit b6011966ac6f402847eb5326beee8da3a80405c7 ]

The dst entry should be released if no neighbour is found. Goto label
free_dst to fix the issue. Besides, the check of ndev against NULL is
redundant.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Link: https://lore.kernel.org/r/20210121145738.51091-1-bianpan2016@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c