From: Markus Elfring <[email protected]>
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 <[email protected]>
---
 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to