diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-05-20 10:30:17 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-05-22 19:17:28 -0700 |
commit | 5b17a4971d3b2a073f4078dd65331efbe35baa2d (patch) | |
tree | f92d5b44c00762bdbfc957df8608d62e453fc7b5 | |
parent | 6ca328e985cd995dfd1d5de44046e6074f853fbb (diff) | |
download | linux-stable-5b17a4971d3b2a073f4078dd65331efbe35baa2d.tar.gz linux-stable-5b17a4971d3b2a073f4078dd65331efbe35baa2d.tar.bz2 linux-stable-5b17a4971d3b2a073f4078dd65331efbe35baa2d.zip |
forcedeth: Fix an error handling path in nv_probe()
If an error occures after calling nv_mgmt_acquire_sema(), it should be
undone with a corresponding nv_mgmt_release_sema() call.
Add it in the error handling path of the probe as already done in the
remove function.
Fixes: cac1c52c3621 ("forcedeth: mgmt unit interface")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Zhu Yanjun <zyjzyj2000@gmail.com>
Link: https://lore.kernel.org/r/355e9a7d351b32ad897251b6f81b5886fcdc6766.1684571393.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/ethernet/nvidia/forcedeth.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 0605d1ee490d..7a549b834e97 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -6138,6 +6138,7 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) return 0; out_error: + nv_mgmt_release_sema(dev); if (phystate_orig) writel(phystate|NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl); out_freering: |