net: af_key: add check for pfkey_broadcast in function pfkey_process
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Tue, 17 May 2022 09:42:31 +0000 (17:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 May 2022 07:57:32 +0000 (09:57 +0200)
commitad54e63b832d70df47b2b7910e40373429c9dac3
treeb654661ca99928d228a1e26bb673d846567ccd27
parent4048778318167e535eb9c012dabbc986fe8452e3
net: af_key: add check for pfkey_broadcast in function pfkey_process

[ Upstream commit 4dc2a5a8f6754492180741facf2a8787f2c415d7 ]

If skb_clone() returns null pointer, pfkey_broadcast() will
return error.
Therefore, it should be better to check the return value of
pfkey_broadcast() and return error if fails.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/key/af_key.c