dmaenegine: Delete a check before free_percpu()
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 1 Dec 2014 05:06:57 +0000 (06:06 +0100)
committerVinod Koul <vinod.koul@intel.com>
Tue, 9 Dec 2014 09:26:55 +0000 (14:56 +0530)
The free_percpu() 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>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/dmaengine.c

index 24bfaf0..e057935 100644 (file)
@@ -330,8 +330,7 @@ static int __init dma_channel_table_init(void)
        if (err) {
                pr_err("initialization failure\n");
                for_each_dma_cap_mask(cap, dma_cap_mask_all)
-                       if (channel_table[cap])
-                               free_percpu(channel_table[cap]);
+                       free_percpu(channel_table[cap]);
        }
 
        return err;