dma: imx-dma: Remove redundant NULL check before kfree
authorSyam Sidhardhan <syamsidhardh@gmail.com>
Sun, 24 Feb 2013 23:16:26 +0000 (04:46 +0530)
committerVinod Koul <vinod.koul@intel.com>
Mon, 15 Apr 2013 04:21:18 +0000 (09:51 +0530)
kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/imx-dma.c

index 7d08ab7..f285833 100644 (file)
@@ -859,8 +859,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic(
 
        desc = list_first_entry(&imxdmac->ld_free, struct imxdma_desc, node);
 
-       if (imxdmac->sg_list)
-               kfree(imxdmac->sg_list);
+       kfree(imxdmac->sg_list);
 
        imxdmac->sg_list = kcalloc(periods + 1,
                        sizeof(struct scatterlist), GFP_KERNEL);