From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753723AbdJGWjC (ORCPT ); Sat, 7 Oct 2017 18:39:02 -0400 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:20415 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753670AbdJGWi4 (ORCPT ); Sat, 7 Oct 2017 18:38:56 -0400 From: "Levin, Alexander (Sasha Levin)" Cc: Sudip Mukherjee , Sudip Mukherjee , Hans Verkuil , Mauro Carvalho Chehab , "Levin, Alexander (Sasha Levin)" X-Host: surveyor.tdc.vzwcorp.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH review for 3.18 12/12] [media] bt8xx: fix memory leak Thread-Topic: [PATCH review for 3.18 12/12] [media] bt8xx: fix memory leak Thread-Index: AQHTP7zuQtFiYBGdeUCnJHevQ25Xmg== Date: Sat, 7 Oct 2017 22:38:01 +0000 Message-ID: <20171007223752.25085-12-alexander.levin@verizon.com> References: <20171007223752.25085-1-alexander.levin@verizon.com> In-Reply-To: <20171007223752.25085-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v97Md92w026044 From: Sudip Mukherjee [ Upstream commit 6792eb0cf9310ec240b7e7c9bfa86dff4c758c68 ] If dvb_attach() fails then we were just printing an error message and exiting but the memory allocated to state was not released. Signed-off-by: Sudip Mukherjee Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/pci/bt8xx/dvb-bt8xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c b/drivers/media/pci/bt8xx/dvb-bt8xx.c index d407244fd1bc..bd0f5b195188 100644 --- a/drivers/media/pci/bt8xx/dvb-bt8xx.c +++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c @@ -680,6 +680,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) /* DST is not a frontend, attaching the ASIC */ if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) { pr_err("%s: Could not find a Twinhan DST\n", __func__); + kfree(state); break; } /* Attach other DST peripherals if any */ -- 2.11.0