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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221009034009.60026-3-yangyingliang@huawei.com>
Date:   Sun, 9 Oct 2022 11:40:08 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     <linux-kernel@...r.kernel.org>
CC:     <chenhuacai@...nel.org>, <lvjianmin@...ngson.cn>,
        <chenhuacai@...ngson.cn>
Subject: [PATCH -next 2/3] platform/loongarch: laptop: add missing generic_subdriver_exit() in generic_acpi_laptop_init()

Add missing generic_subdriver_exit() in generic_acpi_laptop_init()
in error path.

Fixes: ee7fa5029de8 ("LoongArch: Add ACPI-based generic laptop driver")
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
 drivers/platform/loongarch/loongson-laptop.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/platform/loongarch/loongson-laptop.c b/drivers/platform/loongarch/loongson-laptop.c
index d9f82c3991c0..a9fdfac50f35 100644
--- a/drivers/platform/loongarch/loongson-laptop.c
+++ b/drivers/platform/loongarch/loongson-laptop.c
@@ -582,6 +582,8 @@ static int __init generic_acpi_laptop_init(void)
 	for (i = 0; i < ARRAY_SIZE(generic_sub_drivers); i++) {
 		ret = generic_subdriver_init(&generic_sub_drivers[i]);
 		if (ret < 0) {
+			while (--i >= 0)
+				generic_subdriver_exit(&generic_sub_drivers[i]);
 			input_free_device(generic_inputdev);
 			return ret;
 		}
@@ -589,6 +591,8 @@ static int __init generic_acpi_laptop_init(void)
 
 	ret = input_register_device(generic_inputdev);
 	if (ret < 0) {
+		while (--i >= 0)
+			generic_subdriver_exit(&generic_sub_drivers[i]);
 		input_free_device(generic_inputdev);
 		pr_err("Unable to register input device\n");
 		return ret;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ