diff mbox series

[1/3] dmaengine: timb_dma: Return directly after a failed kzalloc() in td_alloc_init_desc()

Message ID 4b7b5eed-d00e-43ea-afb6-1f563fb2577c@web.de (mailing list archive)
State Rejected
Headers show
Series dmaengine: timb_dma: Adjustments for td_alloc_init_desc() | expand

Commit Message

Markus Elfring Dec. 25, 2023, 10:18 a.m. UTC
From: Markus Elfring <elfring@users.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@users.sourceforge.net>
---
 drivers/dma/timb_dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
2.43.0
diff mbox series

Patch

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;

 }