[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4b7b5eed-d00e-43ea-afb6-1f563fb2577c@web.de>
Date: Mon, 25 Dec 2023 11:18:30 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: dmaengine@...r.kernel.org, kernel-janitors@...r.kernel.org,
Vinod Koul <vkoul@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, cocci@...ia.fr
Subject: [PATCH 1/3] dmaengine: timb_dma: Return directly after a failed
kzalloc() in td_alloc_init_desc()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 25 Dec 2023 10:40:12 +0100
1. Return directly after a call of the function “kzalloc” failed
at the beginning.
2. Delete the label “out” which became unnecessary with this refactoring.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/dma/timb_dma.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index 7410025605e0..abcab0b1ad3b 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -327,7 +327,7 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan)
td_desc = kzalloc(sizeof(struct timb_dma_desc), GFP_KERNEL);
if (!td_desc)
- goto out;
+ return NULL;
td_desc->desc_list_len = td_chan->desc_elems * TIMB_DMA_DESC_SIZE;
@@ -352,7 +352,6 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan)
err:
kfree(td_desc->desc_list);
kfree(td_desc);
-out:
return NULL;
}
--
2.43.0
Powered by blists - more mailing lists