Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3814230ybg; Mon, 28 Oct 2019 20:09:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtmLmllSNrMGvlvz/WQ139KRvI69M9S3jhhvQ624IXgju6xhu4ziZEt19WggLg1HEScDHN X-Received: by 2002:a17:906:6d4f:: with SMTP id a15mr1044694ejt.33.1572318578624; Mon, 28 Oct 2019 20:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572318578; cv=none; d=google.com; s=arc-20160816; b=T4fXmdtoxztzuhWoriD2zWMe2qhnGyyc/K8/QXCgSbjo2R0qsJbcIZb3gf1c4jmMNA DebzNnq33j5SdVklXHmQJgeouYQMfmvom+DcvUJ2uuKUB0BNd+UcdDnwuygTFyjRawZD oRwdoVBCc3tNcoESJ3igchkNOKqASl2f1XHNE3U8xVsgVAjExyzHIlCQwyUh4QXEN8Kd lmDLawbXR/wZU+XkwWOMWsWrr5p9vMpfrnlZSBgRgFSVxAlhOO5Tuatq7OEBpBEsuNf0 0uOuIsYQ3pftWZcP06e6Vi8OEjABlcX8coJPzvE6+o//GFuOag5hznEYYYsE2kyHO+Cm YbmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=AFCr3rynD8V4Xu0si+l9pX7hWrr9yeLzz/mOG9Iw2wc=; b=LvPn7WBFppJSBrsjbXSqUSxSpzrTq3ENMKq4b4HjPg2v2SS7XIfnsOKV4GQ6bY8kdB 4IXqcjoN3yQWU1qtH3IgWX8bbRe2ZAAsLx7VGxV2KahbvU0uWAQ69F+7uMkk+0ex/ghI ySy6CX0PkvK4XLf5jADjH75kC8Ecv/AZHtnwUk0Q9ezzdP9u4XHtxHjFl0w2vDzHPTEL VeSWfeW/nt+3+SfhjNobREYK/eJAzM161kis6Cb/Rvp2pGxNNP/I4lPRHd3M39Af7UTm vZmkIMvj8Zj5B69UnyiNgoN4Kb5CYdRqpDhm0G4hY/BXoV/NlEWhXbks9+411RUiodiy Z8ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=G0w0eKog; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y42si8881515edd.191.2019.10.28.20.09.15; Mon, 28 Oct 2019 20:09:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=G0w0eKog; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390473AbfJ1O4z (ORCPT + 99 others); Mon, 28 Oct 2019 10:56:55 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:40078 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390428AbfJ1O4z (ORCPT ); Mon, 28 Oct 2019 10:56:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=AFCr3rynD8V4Xu0si+l9pX7hWrr9yeLzz/mOG9Iw2wc=; b=G0w0eKogHrhP q8K6V3DrJgZC7vPrVoys+O16CN+nQi6vYsFPu8CvMZEwCu5kkSS4vSxjP3s7vUiAjyT4NK3LXZEyV jL/XjtfWFgEw2xMIxEP60y7Y8B3QdjH5BHZfNy8tuaf8+JJbATHxKGqcJUUP1mlVNnb1QD2L2Btzj J8NKk=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=ypsilon.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iP6Rk-0008Rv-0Q; Mon, 28 Oct 2019 14:56:40 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 6969827403EF; Mon, 28 Oct 2019 14:56:38 +0000 (GMT) From: Mark Brown To: Navid Emamdoost Cc: alsa-devel@alsa-project.org, "Cc:"@sirena.co.uk, "Cc:"@sirena.co.uk, emamd001@umn.edu, Greg Kroah-Hartman , Jaroslav Kysela , kjlu@umn.edu, Liam Girdwood , linux-kernel@vger.kernel.org, Mark Brown , Pierre-Louis Bossart , Ranjani Sridharan , smccaman@umn.edu, Takashi Iwai , Wei Yongjun Subject: Applied "ASoC: SOF: Fix memory leak in sof_dfsentry_write" to the asoc tree In-Reply-To: <20191027194856.4056-1-navid.emamdoost@gmail.com> X-Patchwork-Hint: ignore Message-Id: <20191028145638.6969827403EF@ypsilon.sirena.org.uk> Date: Mon, 28 Oct 2019 14:56:38 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: SOF: Fix memory leak in sof_dfsentry_write has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From c0a333d842ef67ac04adc72ff79dc1ccc3dca4ed Mon Sep 17 00:00:00 2001 From: Navid Emamdoost Date: Sun, 27 Oct 2019 14:48:47 -0500 Subject: [PATCH] ASoC: SOF: Fix memory leak in sof_dfsentry_write In the implementation of sof_dfsentry_write() memory allocated for string is leaked in case of an error. Go to error handling path if the d_name.name is not valid. Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test") Signed-off-by: Navid Emamdoost Link: https://lore.kernel.org/r/20191027194856.4056-1-navid.emamdoost@gmail.com Signed-off-by: Mark Brown --- sound/soc/sof/debug.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c index 54cd431faab7..5529e8eeca46 100644 --- a/sound/soc/sof/debug.c +++ b/sound/soc/sof/debug.c @@ -152,8 +152,10 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer, */ dentry = file->f_path.dentry; if (strcmp(dentry->d_name.name, "ipc_flood_count") && - strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) - return -EINVAL; + strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) { + ret = -EINVAL; + goto out; + } if (!strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) flood_duration_test = true; -- 2.20.1