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]
Date:	Fri, 15 Feb 2008 10:55:47 +0530
From:	"Thomas, Sujith" <sujith.thomas@...el.com>
To:	"Andrew Morton" <akpm@...ux-foundation.org>
Cc:	<lenb@...nel.org>, <mingo@...e.hu>, <linux-acpi@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>,
	<linux-pm@...ts.linux-foundation.org>,
	"Zhang, Rui" <rui.zhang@...el.com>
Subject: [patch 6/6] Intel Menlow : extract return values using PTR_ERR

From: Thomas Sujith <sujith.thomas@...el.com>

Need to extract errors using PTR_ERR macro and
process accordingly.thermal_cooling_device_register
returning NULL means that CONFIG_THERMAL=n and in that
case no need to create symbolic links.

Signed-off-by: Thomas Sujith <sujith.thomas@...el.com>
---

 drivers/misc/intel_menlow.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

Index: linux-2.6.24/drivers/misc/intel_menlow.c
===================================================================
--- linux-2.6.24.orig/drivers/misc/intel_menlow.c
+++ linux-2.6.24/drivers/misc/intel_menlow.c
@@ -170,10 +170,13 @@ static int intel_menlow_memory_add(struc
 
 	cdev = thermal_cooling_device_register("Memory controller",
device,
 					       &memory_cooling_ops);
-	acpi_driver_data(device) = cdev;
-	if (!cdev)
-		result = -ENODEV;
-	else {
+	if (IS_ERR(cdev)) {
+		result = PTR_ERR(cdev);
+		goto end;
+	}
+
+	if (cdev) {
+		acpi_driver_data(device) = cdev;
 		result = sysfs_create_link(&device->dev.kobj,
 					&cdev->device.kobj,
"thermal_cooling");
 		if (result)

Download attachment "[patch 6 of 6] Intel Menlow - extract return value using PTR_ERR" of type "application/octet-stream" (1087 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ