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: <20061108155921.62f9a68f.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Wed, 8 Nov 2006 15:59:21 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	LHMS <lhms-devel@...ts.sourceforge.net>,
	Andrew Morton <akpm@...l.org>
Subject: [PATHC] [2.6.19-rc4-mm2] driver/base/memory.c :: remove warnings of
 sysfs_create_file()

I got following messages at compile time.
==
drivers/base/memory.c: In function `memory_dev_init':
drivers/base/memory.c:293: warning: ignoring return value of `sysfs_create_file'
, declared with attribute warn_unused_result
==

This patch adds tests for returned value from sysfs_create_file().
This patch just prints warning if failed.

Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>

Index: linux-2.6.19-rc4-mm2/drivers/base/memory.c
===================================================================
--- linux-2.6.19-rc4-mm2.orig/drivers/base/memory.c	2006-11-08 15:15:59.000000000 +0900
+++ linux-2.6.19-rc4-mm2/drivers/base/memory.c	2006-11-08 15:26:52.000000000 +0900
@@ -290,8 +290,14 @@
 
 static int block_size_init(void)
 {
-	sysfs_create_file(&memory_sysdev_class.kset.kobj,
-		&class_attr_block_size_bytes.attr);
+	int ret;
+	ret = sysfs_create_file(&memory_sysdev_class.kset.kobj,
+				&class_attr_block_size_bytes.attr);
+	if (ret < 0) {
+		/* We failed to init memory-hotplug infrastructure.
+		   But don't panic here */
+		printk(KERN_WARNING "cannot create memory hotplug interface\n");
+	}
 	return 0;
 }
 
@@ -323,8 +329,14 @@
 
 static int memory_probe_init(void)
 {
-	sysfs_create_file(&memory_sysdev_class.kset.kobj,
+	int ret;
+	ret = sysfs_create_file(&memory_sysdev_class.kset.kobj,
 		&class_attr_probe.attr);
+	if (ret < 0) {
+		/* we failed to init memory hotplug infrastructure.
+		   But don't panic here */
+		printk(KERN_WARNING "cannot create memory hotplug interface\n");
+	}
 	return 0;
 }
 #else

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ