[PATCH 4.14 026/211] EDAC, thunderx: Fix memory leak in thunderx_l2c_threaded_isr()

From: Greg Kroah-Hartman
Date: Wed Nov 27 2019 - 15:46:58 EST


From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

[ Upstream commit d8c27ba86a2fd806d3957e5a9b30e66dfca2a61d ]

Fix memory leak in L2c threaded interrupt handler.

[ bp: Rewrite commit message. ]

Fixes: 41003396f932 ("EDAC, thunderx: Add Cavium ThunderX EDAC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Borislav Petkov <bp@xxxxxxx>
CC: David Daney <david.daney@xxxxxxxxxx>
CC: Jan Glauber <jglauber@xxxxxxxxxx>
CC: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
CC: Sergey Temerkhanov <s.temerkhanov@xxxxxxxxx>
CC: linux-edac <linux-edac@xxxxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/20181013102843.GG16086@mwanda
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/edac/thunderx_edac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c
index f35d87519a3e8..dfefa39e93519 100644
--- a/drivers/edac/thunderx_edac.c
+++ b/drivers/edac/thunderx_edac.c
@@ -1905,7 +1905,7 @@ static irqreturn_t thunderx_l2c_threaded_isr(int irq, void *irq_id)
default:
dev_err(&l2c->pdev->dev, "Unsupported device: %04x\n",
l2c->pdev->device);
- return IRQ_NONE;
+ goto err_free;
}

while (CIRC_CNT(l2c->ring_head, l2c->ring_tail,
@@ -1927,7 +1927,7 @@ static irqreturn_t thunderx_l2c_threaded_isr(int irq, void *irq_id)
l2c->ring_tail++;
}

- return IRQ_HANDLED;
+ ret = IRQ_HANDLED;

err_free:
kfree(other);
--
2.20.1