* [PATCH] dma: imx-dma: Remove redundant NULL check before kfree
@ 2013-02-24 23:16 Syam Sidhardhan
2013-03-21 9:07 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Syam Sidhardhan @ 2013-02-24 23:16 UTC (permalink / raw)
To: linux-kernel; +Cc: syamsidhardh, vinod.koul, djbw
kfree on NULL pointer is a no-op.
Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
---
drivers/dma/imx-dma.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 70b8975..0988583 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -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);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dma: imx-dma: Remove redundant NULL check before kfree
2013-02-24 23:16 [PATCH] dma: imx-dma: Remove redundant NULL check before kfree Syam Sidhardhan
@ 2013-03-21 9:07 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2013-03-21 9:07 UTC (permalink / raw)
To: Syam Sidhardhan; +Cc: linux-kernel, djbw
On Mon, Feb 25, 2013 at 04:46:26AM +0530, Syam Sidhardhan wrote:
> kfree on NULL pointer is a no-op.
>
> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Applied thanks
> ---
> drivers/dma/imx-dma.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
> index 70b8975..0988583 100644
> --- a/drivers/dma/imx-dma.c
> +++ b/drivers/dma/imx-dma.c
> @@ -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);
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-21 9:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-24 23:16 [PATCH] dma: imx-dma: Remove redundant NULL check before kfree Syam Sidhardhan
2013-03-21 9:07 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox