From patchwork Thu Dec 7 00:04:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 751093 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 E13E3C10F05 for ; Thu, 7 Dec 2023 00:06:23 +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 A8A0BDEC; Thu, 7 Dec 2023 01:06:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A8A0BDEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1701907581; bh=IORLyZHuQUUJEJrrgT0D5n2c1eIPRz0/S4XkUb2/NT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=juxJRI2EOMjT9y6mW4n6ziFkHmISZSM2B74SNXOlFhSlJ8iESKZjffO34YFd0XWyw FNs2K2Hfz0GvP/cFQ2AShINo83iGq8Tgs1xvtp/dt4oHGCPWyGOBWQ2SRBLksw2YK6 3ox3C/v/navzh9JhQgtjiN8qCVWTwS3X/tyc2qAY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7E2F4F8067D; Thu, 7 Dec 2023 01:05:01 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 2AAF5F80641; Thu, 7 Dec 2023 01:05:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7AA01F8057B; Thu, 7 Dec 2023 01:04:53 +0100 (CET) Received: from irl.hu (irl.hu [95.85.9.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with UTF8SMTPS id E19F6F8061B for ; Thu, 7 Dec 2023 01:04:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E19F6F8061B Received: from fedori.lan (51b690cd.dsl.pool.telekom.hu [::ffff:81.182.144.205]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 0000000000071702.0000000065710C16.001190F6; Thu, 07 Dec 2023 01:04:38 +0100 From: Gergo Koteles To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Gergo Koteles Subject: [PATCH 14/16] ALSA: hda/tas2781: call cleaner functions only once Date: Thu, 7 Dec 2023 01:04:30 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Mime-Version: 1.0 X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 Message-ID-Hash: IDDKQQYCMNP2DETWAQ5XPRJSW7NFGIQW X-Message-ID-Hash: IDDKQQYCMNP2DETWAQ5XPRJSW7NFGIQW X-MailFrom: soyer@irl.hu 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.9 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: Prevent double free if only the DSP firmware is missing Signed-off-by: Gergo Koteles --- sound/pci/hda/tas2781_hda_i2c.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index 0972345c15e5..cb8872e15bb0 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -660,11 +660,6 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context) tasdevice_apply_calibration(tas_priv); out: - if (tas_priv->fw_state == TASDEVICE_DSP_FW_FAIL) { - /*If DSP FW fail, kcontrol won't be created */ - tasdevice_config_info_remove(tas_priv); - tasdevice_dsp_remove(tas_priv); - } mutex_unlock(&tas_hda->priv->codec_lock); if (fmw) release_firmware(fmw);