Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9182120pxu; Mon, 28 Dec 2020 08:37:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOsW2b3MpWI6+tHP0ioCc6Cs+mKSPs+Z3Ek5uJiw813Wj+eFCuCkhThuIYalMiwpYwrj4Z X-Received: by 2002:a17:906:fa8b:: with SMTP id lt11mr42249652ejb.94.1609173451331; Mon, 28 Dec 2020 08:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173451; cv=none; d=google.com; s=arc-20160816; b=nQjpaMAablOBToDfi49n5r6p/c/Tssuir+JSp4BZPLY1cb8XGphxn0qgyvji6yP7px 8PP+c0TpwuBx/Twsmh11vXVSnUadI25RKr4HWC5EBqp5yvMH3IswjDYkkIAziNb/Refr j6Im5NwWHHPUVKBYuRFYOp1Z+tGn5MIEZZDGAXTf/YpyL1BsSMe+/Xl9m6TMB2kPZbEi 6vOJFKCrUFCkMaozerEs5QwyDVeMVt35jfbynwHpW08KCCdprXIGMF32A+fAj5IdVRyG FCI4YQZD7qx/p5jimLVMNCglomFvX3/6yBGThaUCwYnG+aoO41iZ4e8zDSvXNodKC9Nm NB8A== 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=TgDnxc2ZjRRX+kDJlFQBEWrzU1RXS12YVH5TbrzSPdA=; b=K/onSOoYcdBqrjp6gZmTiAhh/s3bcs2E7tzpd/xOzubvy2tCg4Xc6E5Y4e3gFbvfD0 Ox6L35g3GuIXK/sJ9iwrIXflkeRXSFnBJMKNHRwGclxlgtv5SsyFb1VvIB5i6zxmtQJL BiUBYZveeyBVlZKjHVIp2Rv4kXYzLfJjF2YYrf1svw4lN45G/PUKqYhUyH94F6LtOhP0 OEkE6e/mYxYdFAwS3NWWeDtIU4KMxUtDf8cFOF8ojTL+ixeKZ3ImsCKdMKuAaKbwJ7RE J8HyhwRP+N3xvrpbdGYmwjE+2A/IMtt3aeYj0yEAKySbdl458RMBvCdaktcthDSWIB7e FEAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GeEoW3Ot; 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 m8si18707049ejr.206.2020.12.28.08.37.06; Mon, 28 Dec 2020 08:37:31 -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=GeEoW3Ot; 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 S2633665AbgL1QeZ (ORCPT + 99 others); Mon, 28 Dec 2020 11:34:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:58372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730078AbgL1NC1 (ORCPT ); Mon, 28 Dec 2020 08:02:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8142521D94; Mon, 28 Dec 2020 13:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160532; bh=ZijW0fd6+XeeCoA6v6xCG6PygtIcTmm7hOp34t7rj+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GeEoW3OtllEcF+ZUXhLURT86ToqeVjhOJEcRgo9oQlKDKS3SHvarqazBfhYn/N6m1 omS1rtGhNPDesKDnw39bZZi5TC0H1oxUjMy5EBUUK9JByTEpXm3Q6k4I6YQAxMJ3w2 nOeEcSlnE0pVii7sWosoqhDkPT5j2yMVLwawNuX8= 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.9 082/175] media: siano: fix memory leak of debugfs members in smsdvb_hotplug Date: Mon, 28 Dec 2020 13:48:55 +0100 Message-Id: <20201228124857.212997058@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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 9148e14c9d077..9d5eb8b6aede9 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