Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9122104pxu; Mon, 28 Dec 2020 07:10:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxooRQ9kAsw9MPaVm+kJRCMimy66JzN/iq2O5OOwW9Y7VRp1bmpUVeCMoIfhbCAAK6S62Oj X-Received: by 2002:a17:907:414c:: with SMTP id od20mr41647150ejb.75.1609168220082; Mon, 28 Dec 2020 07:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168220; cv=none; d=google.com; s=arc-20160816; b=xu1LwmolNXvX6qECioC95VgUjk9HIGuCIqhJOjHIy5U9Nme4BEOzDwkQAVsPXyv0ce zL9AZw8Za5phWkyxKFAfW8KB1y+B8PIMP+PJdeqaCHURP4qPoIg/Na1/BWpEDkWEIaLJ JnpjDJnOC3jgQtZXSGYIBFp6MkOb0nAbg7I7mntT4ELey6CRm8RfgjAs+cncuwvrKlES TTgummPbb+YBeyPKkYE0W3cHcHf1b0YhXUFV8bQIZZUsQSOwRZOIpF15KP2V3f2dKsbm wTJwzvxpM4Au0YiO0zu38rcETRLHaeLBVOUXljGyIuZvAGxGQqxeyGygnfhB7OOS/K6v +gnw== 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=+X/K1cJskzkutrehf53kydAuWInG/j6GJyyEahwWnhg=; b=NoBpYbVitnGLe4S7pGca7fFn/HE0K7cq6hQClynNWnSQIpq4EGcCbfeYG5t9e1SuUS /4JE96UokMrw7IMv8sLv9ViSaVFFk1R7Uu8iCkIW/rRf61l2Ll9CB7b17KcYcAwIugS6 Gs45kXz1ng1TFUOG3I+pE3IIhMocJ//RvMz8SfQN3TauBni5zTXaerH4d3/xKGtd0fFH mFIMOtZ43jAu6u0KAKbwL4F4GhOiXtk0RpQ6gzC2ioI5bUq1/v/x66sKBvdaTWUsP2D6 ezt5kwQhDvhC6wt6DA7vULoZoPyleSRaebW4wkjqJ5mJOE5eYwW8uH+AhfcjGwvJixm8 P/lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sz5Wywlo; 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 o16si18304397eji.436.2020.12.28.07.09.56; Mon, 28 Dec 2020 07:10:20 -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=sz5Wywlo; 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 S2439080AbgL1OKl (ORCPT + 99 others); Mon, 28 Dec 2020 09:10:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:44946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439029AbgL1OK2 (ORCPT ); Mon, 28 Dec 2020 09:10:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3A95A20715; Mon, 28 Dec 2020 14:09:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164587; bh=9SWr3GY0CZmbvRCe5GvFrozejTm1sVJ+CVP5sXM0E9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sz5Wywlov0TverO1sFE5pFS1Ckbu/dbEMhMgqpNn3rZRFtQ9itPwM87LM0zzPYy3X 7D9jWSVCjOCsIuq0DHOP259F5foSEz2jX13s6+KCHgssPFrDDPevH+dNghmjRMDVFp Ocu7TS0W6pOd0ugNk0jifwOHajjcnrRbElsd1tjo= 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 5.10 210/717] media: siano: fix memory leak of debugfs members in smsdvb_hotplug Date: Mon, 28 Dec 2020 13:43:28 +0100 Message-Id: <20201228125031.044432411@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 88f90dfd368b1..ae17407e477a4 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -1169,12 +1169,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