[ldv-project] [PATCH] nitrox: avoid double free on error path in nitrox_sriov_init()
Herbert Xu
herbert at gondor.apana.org.au
Fri Oct 21 14:34:13 MSK 2022
On Wed, Sep 28, 2022 at 01:25:05PM +0300, Natalia Petrova wrote:
> 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.
>
> Signed-off-by: Natalia Petrova <n.petrova at fintech.ru>
> Signed-off-by: Alexey Khoroshilov <khoroshilov at ispras.ru>
> ---
> drivers/crypto/cavium/nitrox/nitrox_mbx.c | 1 +
> 1 file changed, 1 insertion(+)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
More information about the ldv-project
mailing list