[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54BBC5E4.10400@users.sourceforge.net>
Date: Sun, 18 Jan 2015 15:40:36 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: LKML <linux-kernel@...r.kernel.org>
CC: kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 2/3] block-z2ram: Delete an unnecessary check before the function
call "kfree"
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 18 Jan 2015 12:28:27 +0100
The kfree() 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>
---
drivers/block/z2ram.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 968f9e5..c32f248 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -404,10 +404,7 @@ static void __exit z2_exit(void)
}
}
- if ( z2ram_map != NULL )
- {
- kfree( z2ram_map );
- }
+ kfree(z2ram_map);
}
return;
--
2.2.2
--
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