lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221108133858.53308-1-xiujianfeng@huawei.com>
Date:   Tue, 8 Nov 2022 21:38:58 +0800
From:   Xiu Jianfeng <xiujianfeng@...wei.com>
To:     <kvalo@...nel.org>, <davem@...emloft.net>, <edumazet@...gle.com>,
        <kuba@...nel.org>, <pabeni@...hat.com>, <rmani@....qualcomm.com>
CC:     <ath10k@...ts.infradead.org>, <linux-wireless@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] wifi: ath10k: Fix resource leak in ath10k_pci_init()

When ath10k_ahb_init() fails, it does not unregister ath10k_pci_driver,
which will cause a resource leak issue, call pci_unregister_driver() in
the error path to fix this issue.

Fixes: 0b523ced9a3c ("ath10k: add basic skeleton to support ahb")
Signed-off-by: Xiu Jianfeng <xiujianfeng@...wei.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index e56c6a6b1379..22f8f8b20762 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -3800,8 +3800,10 @@ static int __init ath10k_pci_init(void)
 		       ret);
 
 	ret = ath10k_ahb_init();
-	if (ret)
+	if (ret) {
 		printk(KERN_ERR "ahb init failed: %d\n", ret);
+		pci_unregister_driver(&ath10k_pci_driver);
+	}
 
 	return ret;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ