From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86F81C7657C for ; Thu, 27 Feb 2020 14:28:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5203324688 for ; Thu, 27 Feb 2020 14:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582813704; bh=DSFBM7BNuOdb259OtWqXqz7MxqSG3Bzku8QvVO0rB9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bgbeBUZJpdB7lf8ao7KhyA7BYi2eE6JxoVEJb/eylqPNZOlun759yqbc+sXwOHsPl RFi0wCeRK6Ey5RfTUIO+irDCjYaRWKRc3PBtX7lWO4eD7XaGFLCUFzIdseIfVLMvGb L+nMD9wGpOPw4IjPU2RuoGG2xkzZIwTJQ4Re2z+Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388122AbgB0OHi (ORCPT ); Thu, 27 Feb 2020 09:07:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:45026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388088AbgB0OHb (ORCPT ); Thu, 27 Feb 2020 09:07:31 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6047320578; Thu, 27 Feb 2020 14:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812450; bh=DSFBM7BNuOdb259OtWqXqz7MxqSG3Bzku8QvVO0rB9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IPweOxXzj8zii6wZezbmeGRMkPVE/nJ6hIoFlu0oQjylVLsGJipcw2Ux1W9ePmV6z prfw5+NPtNVdF772Z3NzU1X1U0CxPo7vzHJoWJN/amCgR7N/8TRxPzAFnlpxCaxa29 j8sxXk8ws0Upq71NPikDe6rw4WAAdgk6RmaJx/kg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Samuel Holland , Mark Brown Subject: [PATCH 5.4 005/135] ASoC: codec2codec: avoid invalid/double-free of pcm runtime Date: Thu, 27 Feb 2020 14:35:45 +0100 Message-Id: <20200227132229.738164008@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132228.710492098@linuxfoundation.org> References: <20200227132228.710492098@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Samuel Holland commit b6570fdb96edf45bcf71884bd2644bd73d348d1a upstream. The PCM runtime was freed during PMU in the case that the event hook encountered an error. However, it is also unconditionally freed during PMD. Avoid a double-free by dropping the call to kfree in the PMU hook. Fixes: a72706ed8208 ("ASoC: codec2codec: remove ephemeral variables") Cc: stable@vger.kernel.org Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20200213061147.29386-2-samuel@sholland.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-dapm.c | 3 --- 1 file changed, 3 deletions(-) --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3888,9 +3888,6 @@ snd_soc_dai_link_event_pre_pmu(struct sn runtime->rate = params_rate(params); out: - if (ret < 0) - kfree(runtime); - kfree(params); return ret; }