From: Markus Elfring <Markus.Elfring@web.de>
To: dmaengine@vger.kernel.org, kernel-janitors@vger.kernel.org,
Vinod Koul <vkoul@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, cocci@inria.fr
Subject: [PATCH 1/3] dmaengine: timb_dma: Return directly after a failed kzalloc() in td_alloc_init_desc()
Date: Mon, 25 Dec 2023 11:18:30 +0100 [thread overview]
Message-ID: <4b7b5eed-d00e-43ea-afb6-1f563fb2577c@web.de> (raw)
In-Reply-To: <ebd531dd-60e3-4ac3-821e-aa9890960283@web.de>
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(-)
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
next prev parent reply other threads:[~2023-12-25 10:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-25 10:15 [PATCH 0/3] dmaengine: timb_dma: Adjustments for td_alloc_init_desc() Markus Elfring
2023-12-25 10:18 ` Markus Elfring [this message]
2023-12-25 10:20 ` [PATCH 2/3] dmaengine: timb_dma: Improve a size determination in td_alloc_init_desc() Markus Elfring
2023-12-25 10:22 ` [PATCH 3/3] dmaengine: timb_dma: One function call less in td_alloc_init_desc() after error detection Markus Elfring
2024-01-22 11:32 ` [PATCH 0/3] dmaengine: timb_dma: Adjustments for td_alloc_init_desc() Vinod Koul
2024-01-22 12:15 ` [0/3] " Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4b7b5eed-d00e-43ea-afb6-1f563fb2577c@web.de \
--to=markus.elfring@web.de \
--cc=cocci@inria.fr \
--cc=dmaengine@vger.kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®