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: <546A419B.7060409@users.sourceforge.net>
Date:	Mon, 17 Nov 2014 19:42:35 +0100
From:	SF Markus Elfring <elfring@...rs.sourceforge.net>
To:	Joel Becker <jlbec@...lplan.org>
CC:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org, Coccinelle <cocci@...teme.lip6.fr>
Subject: [PATCH 1/1] configfs: Deletion of unnecessary checks before the function
 call "config_item_put"

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 17 Nov 2014 19:37:03 +0100

The config_item_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 fs/configfs/file.c | 3 +--
 fs/configfs/item.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/configfs/file.c b/fs/configfs/file.c
index 1d1c41f..48f36e7 100644
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -291,8 +291,7 @@ static int configfs_release(struct inode * inode, struct file * filp)
 	struct module * owner = attr->ca_owner;
 	struct configfs_buffer * buffer = filp->private_data;
 
-	if (item)
-		config_item_put(item);
+	config_item_put(item);
 	/* After this point, attr should not be accessed. */
 	module_put(owner);
 
diff --git a/fs/configfs/item.c b/fs/configfs/item.c
index e65f9ff..891b20e 100644
--- a/fs/configfs/item.c
+++ b/fs/configfs/item.c
@@ -153,8 +153,7 @@ static void config_item_cleanup(struct config_item *item)
 		t->ct_item_ops->release(item);
 	if (s)
 		config_group_put(s);
-	if (parent)
-		config_item_put(parent);
+	config_item_put(parent);
 }
 
 static void config_item_release(struct kref *kref)
-- 
2.1.3

--
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