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]
Date:   Wed, 31 Jan 2018 21:55:13 +0000
From:   Vadim Pasternak <vadimp@...lanox.com>
To:     dvhart@...radead.org, andy.shevchenko@...il.com,
        gregkh@...uxfoundation.org
Cc:     linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org,
        jiri@...nulli.us, Vadim Pasternak <vadimp@...lanox.com>
Subject: [PATCH 11/11] platform/x86: mlx-platform: Add hotplug platform driver un-registration for faulty flow

Add hotplug platform driver un-registration in case regmap cache
synchronization failed. In such case hotplug platform driver registration
should be rolled back.

Signed-off-by: Vadim Pasternak <vadimp@...lanox.com>
---
 drivers/platform/x86/mlx-platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 2d34aa8..1811451 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -548,10 +548,12 @@ static int __init mlxplat_init(void)
 	regcache_mark_dirty(mlxplat_hotplug->regmap);
 	err = regcache_sync(mlxplat_hotplug->regmap);
 	if (err)
-		goto fail_platform_mux_register;
+		goto fail_platform_hotplug_register;
 
 	return 0;
 
+fail_platform_hotplug_register:
+	platform_device_unregister(priv->pdev_hotplug);
 fail_platform_mux_register:
 	while (--i >= 0)
 		platform_device_unregister(priv->pdev_mux[i]);
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ