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:	Sat, 28 Apr 2007 13:30:23 +0800
From:	WANG Cong <xiyou.wangcong@...il.com>
To:	steve@...gwyn.com, pavel@....cz, Paul.Clements@...eleye.com,
	akpm@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org, Wang Ya-gang <lazy_linux@....com>,
	Chen Li-jun <cljun@...ou.edu.cn>
Subject: [-mm Patch]nbd: check the return value of sysfs_create_file


Since 'sysfs_create_file' is declared with attribute warn_unused_result, we must always check its return value carefully.

Signed-off-by: WANG Cong <xiyou.wangcong@...il.com>

---

--- linux-2.6.21-rc7-mm2/drivers/block/nbd.c.orig	2007-04-27 17:27:47.000000000 +0800
+++ linux-2.6.21-rc7-mm2/drivers/block/nbd.c	2007-04-27 17:47:32.000000000 +0800
@@ -373,7 +373,10 @@ static void nbd_do_it(struct nbd_device 
 	BUG_ON(lo->magic != LO_MAGIC);
 
 	lo->pid = current->pid;
-	sysfs_create_file(&lo->disk->kobj, &pid_attr.attr);
+	if (sysfs_create_file(&lo->disk->kobj, &pid_attr.attr)) {
+		printk(KERN_ERR "nbd: sysfs_create_file failed!");
+		return;
+	}
 
 	while ((req = nbd_read_stat(lo)) != NULL)
 		nbd_end_request(req);
-
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