Skip to content

Commit

Permalink
dma: imx-dma: Remove redundant NULL check
Browse files Browse the repository at this point in the history
kfree on a NULL pointer is a no-op. Null pointer check is
not necessary.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Sachin Kamat authored and Vinod Koul committed Sep 2, 2013
1 parent 6b9019a commit 06f8db4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/dma/imx-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,10 +805,8 @@ static void imxdma_free_chan_resources(struct dma_chan *chan)
}
INIT_LIST_HEAD(&imxdmac->ld_free);

if (imxdmac->sg_list) {
kfree(imxdmac->sg_list);
imxdmac->sg_list = NULL;
}
kfree(imxdmac->sg_list);
imxdmac->sg_list = NULL;
}

static struct dma_async_tx_descriptor *imxdma_prep_slave_sg(
Expand Down

0 comments on commit 06f8db4

Please sign in to comment.