Skip to content
Commit 094528b6 authored by Natalia Petrova's avatar Natalia Petrova Committed by Herbert Xu
Browse files

crypto: nitrox - avoid double free on error path in nitrox_sriov_init()



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: 9e5de3e0 ("crypto: cavium/nitrox - Add mailbox...")
Signed-off-by: default avatarNatalia Petrova <n.petrova@fintech.ru>
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 375de984
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment