[PATCH 2/3] block-z2ram: Delete an unnecessary check before the function call "kfree"

SF Markus Elfring
2015-01-18T14:40:46Z

From: Markus Elfring <elfring@users.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@users.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