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: <20251221120538.947670-1-lihaoxiang@isrc.iscas.ac.cn>
Date: Sun, 21 Dec 2025 20:05:38 +0800
From: Haoxiang Li <lihaoxiang@...c.iscas.ac.cn>
To: mporter@...nel.crashing.org,
	alex.bou9@...il.com,
	akpm@...ux-foundation.org,
	dan.carpenter@...aro.org,
	linux@...blig.org
Cc: linux-kernel@...r.kernel.org,
	Haoxiang Li <lihaoxiang@...c.iscas.ac.cn>,
	stable@...r.kernel.org
Subject: [PATCH] rapidio: fix a resource leak when rio_add_device() fails

If rio_add_device() fails, call rio_free_net() to unregister
the net device registered by rio_add_net().

Fixes: e8de370188d0 ("rapidio: add mport char device driver")
Cc: stable@...r.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@...c.iscas.ac.cn>
---
 drivers/rapidio/devices/rio_mport_cdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
index 995cfeca972b..4a804b4ad6f7 100644
--- a/drivers/rapidio/devices/rio_mport_cdev.c
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
@@ -1789,6 +1789,7 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,
 	err = rio_add_device(rdev);
 	if (err) {
 		put_device(&rdev->dev);
+		rio_free_net(net);
 		return err;
 	}
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ