WSL2-Linux-Kernel/drivers/crypto/cavium
Natalia Petrova 9bdf3a59b3 crypto: nitrox - avoid double free on error path in nitrox_sriov_init()
[ Upstream commit 094528b6a5 ]

If alloc_workqueue() fails in nitrox_mbox_init() it deallocates
ndev->iov.vfdev and returns error code, but then nitrox_sriov_init()
calls nitrox_sriov_cleanup() where ndev->iov.vfdev is deallocated
again.

Fix this by nulling ndev->iov.vfdev after the first deallocation.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9e5de3e06e ("crypto: cavium/nitrox - Add mailbox...")
Signed-off-by: Natalia Petrova <n.petrova@fintech.ru>
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:14:21 +01:00
..
cpt crypto: cavium - prevent integer overflow loading firmware 2022-10-26 12:35:28 +02:00
nitrox crypto: nitrox - avoid double free on error path in nitrox_sriov_init() 2022-12-31 13:14:21 +01:00
zip crypto: cavium/zip - remove unused including <linux/version.h> 2021-04-16 21:16:32 +10:00
Makefile