Thread (6 messages) flat view 6 messages, 4 authors, 2023-11-08

Re: [PATCH 1/1] powerpc: fix a memory leak

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2023-09-15 00:50:32
Also in: lkml

Tyrel Datwyler [off-list ref] writes:
On 9/14/23 02:46, Yuanjun Gong wrote:
quoted
When one of the methods xive_native_alloc_irq_on_chip, irq_create_mapping
or irq_get_handler_data fails, the function will directly return without
disposing vinst->name and vinst. Fix it.

Fixes: c20e1e299d93 ("powerpc/vas: Alloc and setup IRQ and trigger port address")
Signed-off-by: Yuanjun Gong <redacted>
---
 arch/powerpc/platforms/powernv/vas.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c
index b65256a63e87..780740b478f0 100644
--- a/arch/powerpc/platforms/powernv/vas.c
+++ b/arch/powerpc/platforms/powernv/vas.c
@@ -54,7 +54,7 @@ static int init_vas_instance(struct platform_device *pdev)
 	struct xive_irq_data *xd;
 	uint32_t chipid, hwirq;
 	struct resource *res;
-	int rc, cpu, vasid;
+	int rc, cpu, vasid, ret;
You can you reuse rc for the return value in the error path instead of
introducing a new ret variable.
Yep, please send a v2.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help