From patchwork Thu Oct 26 08:25:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 739100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64986C25B6B for ; Thu, 26 Oct 2023 08:27:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 011AB827; Thu, 26 Oct 2023 10:26:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 011AB827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1698308829; bh=iQfH7kjWWSYCdi/ONnIK+4qe1rIwBGf/wYH1iugGS+E=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=VPaKpApRf9723TgVwhtxCRewplpdKXJqmqmeKJZpKQtppbQgPEcVSAd9OkKv1I1I0 fsO9qF4vFBQ8KzhAW+T2cAiMX0DFl1iqetVYZOlFFATnoMI37TaADZbA5fml9/WPtU lDgGF3N0M5AbRMfamN7VkFZdGE68ymuFk+dcFaBc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5CA54F8019B; Thu, 26 Oct 2023 10:26:18 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id EA2D6F80165; Thu, 26 Oct 2023 10:26:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2B07DF80165; Thu, 26 Oct 2023 10:26:11 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 80B25F8014B for ; Thu, 26 Oct 2023 10:26:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 80B25F8014B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=RtoXXvI8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698308766; x=1729844766; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=iQfH7kjWWSYCdi/ONnIK+4qe1rIwBGf/wYH1iugGS+E=; b=RtoXXvI8Fr46JdYOvSUp9l7aDZjTXuR4KMob7rKIVM6zlcBjwV+lR6pw 99Arq8yCxwx4prLcVAqZvJmLR8WvsLswdTRpreC0cg1bBAz7IMU/UDwTh TJZ0ihFM/WNjbNgcFl/+HU+9Makk8b157j1/grXJ4nQxmpENRU/PSTey2 0r/8HPuZDcHle6cjqinr9XNcnRB66SMT/BzLP4D8ktLdzJBpH7g92D+0P iY5qYhOX2QHFXARPcSPVeFYW7Jb0xlEc83QdY1cj4FxTkDl25TlvThqPJ YmvfJqNyOSa1VI2U3960FjPK7T28g5/j2WbZC1sn5w8ozRrA3ZLZG9vG9 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="367698977" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="367698977" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 01:26:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="735668748" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="735668748" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga006.jf.intel.com with ESMTP; 26 Oct 2023 01:25:58 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Cc: Cezary Rojewski , Takashi Iwai , Jaroslav Kysela , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, =?utf-8?q?Amadeus?= =?utf-8?q?z_S=C5=82awi=C5=84ski?= Subject: [PATCH] ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails Date: Thu, 26 Oct 2023 10:25:58 +0200 Message-Id: <20231026082558.1864910-1-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: 3JXRAXV2F4XEKGWZPPCPYCU2C3IVE2GW X-Message-ID-Hash: 3JXRAXV2F4XEKGWZPPCPYCU2C3IVE2GW X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Cezary Rojewski Error path in snd_skl_parse_uuids() shall free last allocated module if its instance_id allocation fails. Fixes: f8e066521192 ("ASoC: Intel: Skylake: Fix uuid_module memory leak in failure case") Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/skylake/skl-sst-utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index 57ea815d3f04..b776c58dcf47 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -299,6 +299,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL); if (!module->instance_id) { ret = -ENOMEM; + kfree(module); goto free_uuid_list; }