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: <11821073652554-git-send-email-jsipek@cs.sunysb.edu>
Date:	Sun, 17 Jun 2007 15:09:23 -0400
From:	"Josef 'Jeff' Sipek" <jsipek@...sunysb.edu>
To:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Cc:	akpm@...ux-foundation.org,
	"Josef 'Jeff' Sipek" <jsipek@...sunysb.edu>
Subject: [PATCH 16/16] Unionfs: Remove superfluous check for NULL pointer

Since we use containers and the struct inode is _inside_ the
unionfs_inode_info structure, UNIONFS_I will always (given a non-NULL inode
pointer), return a valid non-NULL pointer.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@...sunysb.edu>
---
 fs/unionfs/fanout.h |    8 +++++++-
 fs/unionfs/super.c  |    6 ------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/unionfs/fanout.h b/fs/unionfs/fanout.h
index d4933ce..4da34c6 100644
--- a/fs/unionfs/fanout.h
+++ b/fs/unionfs/fanout.h
@@ -18,7 +18,13 @@
 #ifndef _FANOUT_H_
 #define _FANOUT_H_
 
-/* Inode to private data */
+/*
+ * Inode to private data
+ *
+ * Since we use containers and the struct inode is _inside_ the
+ * unionfs_inode_info structure, UNIONFS_I will always (given a non-NULL
+ * inode pointer), return a valid non-NULL pointer.
+ */
 static inline struct unionfs_inode_info *UNIONFS_I(const struct inode *inode)
 {
 	return container_of(inode, struct unionfs_inode_info, vfs_inode);
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index 9f248b9..0e6dad1 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -32,12 +32,6 @@ static void unionfs_read_inode(struct inode *inode)
 
 	unionfs_read_lock(inode->i_sb);
 
-	if (!info) {
-		printk(KERN_ERR "unionfs: no kernel memory when allocating "
-		       "inode private data!\n");
-		BUG();
-	}
-
 	memset(info, 0, offsetof(struct unionfs_inode_info, vfs_inode));
 	info->bstart = -1;
 	info->bend = -1;
-- 
1.5.2.rc1.165.gaf9b

-
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