From patchwork Wed Nov 27 20:29:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 11264929 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 129F7139A for ; Wed, 27 Nov 2019 21:37:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDAE12168B for ; Wed, 27 Nov 2019 21:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574890649; bh=7Jtc+OPj6lJy4u5O+w2EvlERek4r1QK+X5iuHSA0rN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uz4HhyYcMIfqHFN7BjXGrbnMWjhSkbisJE2s9/use7erjWZIBMOmGzUS2t9/CWcYP KB4AZIaPBB8hp1l/7lGsaWrfolS4WKGVI0YOxsa+1fIUCBVKfetIREg4Zu/mvL0w3h TasWpanh64mWvIzPnYzLlWGD9TGTjHBfhk+a8TuU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729436AbfK0Uqz (ORCPT ); Wed, 27 Nov 2019 15:46:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:59160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729930AbfK0Uqw (ORCPT ); Wed, 27 Nov 2019 15:46:52 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25D74217AB; Wed, 27 Nov 2019 20:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887611; bh=7Jtc+OPj6lJy4u5O+w2EvlERek4r1QK+X5iuHSA0rN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PM3Au1NeANCtx9zJ2vS+vhJOY5/iNlJEzoKjFOQVzh5qpmCNP32vuNAS4KLumvVmE uPnqUzpum8tlHbclTIcAES1Fwv2OyuT1yImKARKZhnzgSuLWlh736M4O9r5WoVdqi7 gdS74r0scx71YW9gETuH8RJNj2FVavvr/uX/LSso= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Borislav Petkov , David Daney , Jan Glauber , Mauro Carvalho Chehab , Sergey Temerkhanov , linux-edac , Sasha Levin Subject: [PATCH 4.14 026/211] EDAC, thunderx: Fix memory leak in thunderx_l2c_threaded_isr() Date: Wed, 27 Nov 2019 21:29:19 +0100 Message-Id: <20191127203053.623177869@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-edac-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Dan Carpenter [ 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 Signed-off-by: Borislav Petkov CC: David Daney CC: Jan Glauber CC: Mauro Carvalho Chehab CC: Sergey Temerkhanov CC: linux-edac Link: http://lkml.kernel.org/r/20181013102843.GG16086@mwanda Signed-off-by: Sasha Levin --- 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);