Messages in this thread Patch in this message | | | Date | Mon, 25 Dec 2023 11:22:24 +0100 | Subject | [PATCH 3/3] dmaengine: timb_dma: One function call less in td_alloc_init_desc() after error detection | From | Markus Elfring <> |
| |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 25 Dec 2023 10:55:52 +0100
The kfree() function was called in one case by the td_alloc_init_desc() function during error handling even if the passed data structure member contained a null pointer. This issue was detected by using the Coccinelle software.
Thus use another label.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/dma/timb_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c index fc1f67bf9c06..831c67af0237 100644 --- a/drivers/dma/timb_dma.c +++ b/drivers/dma/timb_dma.c @@ -333,7 +333,7 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan)
td_desc->desc_list = kzalloc(td_desc->desc_list_len, GFP_KERNEL); if (!td_desc->desc_list) - goto err; + goto free_td_desc;
dma_async_tx_descriptor_init(&td_desc->txd, chan); td_desc->txd.tx_submit = td_tx_submit; @@ -351,4 +351,5 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan) return td_desc; err: kfree(td_desc->desc_list); +free_td_desc: kfree(td_desc); -- 2.43.0
| |