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

From: SF Markus Elfring
Date: Sun Jan 18 2015 - 09:40:49 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/