Skip to contentSkip to conversation

tracing: Deletion of an unnecessary check before iput()

PATCH New Steven Rostedt 1 participant 1 message Nov 20, 2014 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 tracing: Deletion of an unnecessary check before iput()

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next

Head SHA1: 16a8ef2751801346f1f76a18685b2beb63cd170f

Markus Elfring (1):
tracing: Deletion of an unnecessary check before iput()

----

 kernel/trace/trace_uprobe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---------------------------
commit 16a8ef2751801346f1f76a18685b2beb63cd170f
Author: Markus Elfring <[email protected]>
Date:   Sun Nov 16 14:46:28 2014 +0100

tracing: Deletion of an unnecessary check before iput()

The iput() 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.

kernel/trace/trace_uprobe.c +1 -2
index fd76f8e108ef..8520acc34b18 100644
@@ -552,8 +552,7 @@ error:
 	return ret;
 
 fail_address_parse:
-	if (inode)
-		iput(inode);
+	iput(inode);
 
 	pr_info("Failed to parse address or file.\n");