linux/drivers/crypto/cavium/nitrox
Natalia Petrova 51592cf716 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:32:30 +01:00
..
Kconfig
Makefile
nitrox_aead.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
nitrox_algs.c
nitrox_common.h
nitrox_csr.h
nitrox_debugfs.c crypto: cavium/nitrox - Fix sparse warnings 2020-11-13 20:38:45 +11:00
nitrox_debugfs.h
nitrox_dev.h
nitrox_hal.c crypto: cavium/nitrox - Fix sparse warnings 2020-11-13 20:38:45 +11:00
nitrox_hal.h
nitrox_isr.c crypto: nitrox - fix unchecked variable in nitrox_register_interrupts 2021-06-11 15:02:14 +08:00
nitrox_isr.h crypto: cavium/nitrox - Fix sparse warnings 2020-11-13 20:38:45 +11:00
nitrox_lib.c
nitrox_main.c crypto: cavium/nitrox - remove check of list iterator against head past the loop body 2022-04-08 16:26:43 +08:00
nitrox_mbx.c crypto: nitrox - avoid double free on error path in nitrox_sriov_init() 2022-12-31 13:32:30 +01:00
nitrox_mbx.h
nitrox_req.h crypto: cavium/nitrox - fix typo on crypto 2022-02-18 16:21:08 +11:00
nitrox_reqmgr.c crypto: cavium: Fix a bunch of kernel-doc related issues 2021-05-28 15:11:44 +08:00
nitrox_skcipher.c crypto: cavium: Fix a bunch of kernel-doc related issues 2021-05-28 15:11:44 +08:00
nitrox_sriov.c