Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9044708pxu; Mon, 28 Dec 2020 05:16:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxooXA5kMGv4n0DWr06nBzx80owuvsAUblBWJmp6+7G76O3bXLTjZW7k9ppPxyvY46JobeX X-Received: by 2002:a50:becf:: with SMTP id e15mr43335157edk.138.1609161419417; Mon, 28 Dec 2020 05:16:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161419; cv=none; d=google.com; s=arc-20160816; b=z/UJDYiAoa8PnOSxkhVv0vRKpeoWXZLGHF2iSe4gCiBxDvQWMtWBkglQcWf7tX++Yu ap/wfZ9n6QyWsQhBuELW+wn4PKAuF8agUaz5u+1mQHUMNA44thvMADYMamWo2/JodrLZ H/nYZdh/IG/2WZAG4COwWataP/OLWWnDaZ4XkYyWLqvXLcB1Y+Kaws3QP/Smsu8g7h0L tmsx1gwgXjW/JZj3Aa0K7SrHbFT3UbZcofKWUsbzuWY40ujs9UKdcRigSGSBHUppr3Jb OsRRjgYrs0fT8/EALh/AERuSSb7hDP1m+2bC8xHwsb4Vvz2MD/h02x0v2t9uBr6XNeg0 Npqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=86XQ1diDMWLu3dOdHHOANtSJ3eoF5Qns77wGzW+hCDs=; b=MtdM/sOE2yEgMjE29b+UHwB9nytRrSE4P+AwZApckThlWX229JE0x9imS/gs0yHWAe txO5bLPgnUKRRcIlc+0P8B/GvwiNjhjkPyo8i65uJLlZNCsuwzbww0Dd9y45uVC70Rar 4H7KUXDpJdD6quHvGs1Nency31+Fh3otdMNJ7KHDD9RCcpfk8RXnm76pa2Crpt7cL2nd NC7bR877zqY6Xc6NQXuyG+nrR0yD4o2IlyQSlHeQvTIfl4zcYgRhgkWu6tdN4RKc5wT1 tyu1i/gHJZKiqjtNK3daFLWqBTTvttnt1sScLr4/bSJlBcY39azzQsRUYEJ3EufXuHpB MGzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h2L0Ug9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si20595854edm.287.2020.12.28.05.16.36; Mon, 28 Dec 2020 05:16:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h2L0Ug9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732482AbgL1NOT (ORCPT + 99 others); Mon, 28 Dec 2020 08:14:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:42452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732475AbgL1NOS (ORCPT ); Mon, 28 Dec 2020 08:14:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6F0721D94; Mon, 28 Dec 2020 13:13:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161218; bh=q7SCyNDGjsqalBlUadLCiYrHq+LW1BvNMrDbAsufqrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h2L0Ug9UTB/j/jYQaTKaILipd+6c3pr+f+38ejCxYmGgu6mHyIe2J8NrXg1qv4BUB Htzb5oqiyemWCYGndDOOJMxlHuVWFpmSe8xgMjJHU+Gruf+EdMjWrH045orK01IJfa 4LX+y3buiGr6wGdgyGQMngyc92DWq5uhulhzplyU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keita Suzuki , Sean Young , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 112/242] media: siano: fix memory leak of debugfs members in smsdvb_hotplug Date: Mon, 28 Dec 2020 13:48:37 +0100 Message-Id: <20201228124910.202140634@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Keita Suzuki [ Upstream commit abf287eeff4c6da6aa804bbd429dfd9d0dfb6ea7 ] When dvb_create_media_graph fails, the debugfs kept inside client should be released. However, the current implementation does not release them. Fix this by adding a new goto label to call smsdvb_debugfs_release. Fixes: 0d3ab8410dcb ("[media] dvb core: must check dvb_create_media_graph()") Signed-off-by: Keita Suzuki Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/common/siano/smsdvb-main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index affde1426b7a2..15e895c9f2e0b 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -1180,12 +1180,15 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, rc = dvb_create_media_graph(&client->adapter, true); if (rc < 0) { pr_err("dvb_create_media_graph failed %d\n", rc); - goto client_error; + goto media_graph_error; } pr_info("DVB interface registered.\n"); return 0; +media_graph_error: + smsdvb_debugfs_release(client); + client_error: dvb_unregister_frontend(&client->frontend); -- 2.27.0