summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-07-28 22:48:59 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-28 23:07:41 (GMT)
commitc3491eca37fe1e333c7daf48f00df1efadc71b0b (patch)
treee5944282a6c23cfa46059389130597f486df6cc2
parentfb399b4854d2159a4d23fbfbd7daaed914fd54fa (diff)
downloadlinux-c3491eca37fe1e333c7daf48f00df1efadc71b0b.tar.xz
zsmalloc: Delete an unnecessary check before the function call "iput"
iput() 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. Link: http://lkml.kernel.org/r/559cf499-4a01-25f9-c87f-24d906626a57@users.sourceforge.net Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Acked-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/zsmalloc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index cd2a81e..b0bc023 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -2174,8 +2174,7 @@ static int zs_register_migration(struct zs_pool *pool)
static void zs_unregister_migration(struct zs_pool *pool)
{
flush_work(&pool->free_work);
- if (pool->inode)
- iput(pool->inode);
+ iput(pool->inode);
}
/*