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>] [day] [month] [year] [list]
Message-Id: <20200613191208.17633-1-wu000273@umn.edu>
Date:   Sat, 13 Jun 2020 14:12:07 -0500
From:   wu000273@....edu
To:     kjlu@....edu
Cc:     wu000273@....edu, Takashi Iwai <tiwai@...e.de>,
        Greg Kroah-Hartman <gregkh@...e.de>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] edd: Fix a reference count leak.

From: Qiushi Wu <wu000273@....edu>

kobject_init_and_add() takes reference even when it fails.
If this function returns an error, kobject_put() must be called to
properly clean up the memory associated with the object.

Fixes: dd002e807486 ("Kobject: change drivers/firmware/edd.c to use kobject_init_and_add")
Signed-off-by: Qiushi Wu <wu000273@....edu>
---
 drivers/firmware/edd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 14d0970a7198..c8bb58824a76 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -718,6 +718,8 @@ edd_device_register(struct edd_device *edev, int i)
 	if (!error) {
 		edd_populate_dir(edev);
 		kobject_uevent(&edev->kobj, KOBJ_ADD);
+	} else {
+		kobject_put(&edev->kobj);
 	}
 	return error;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ