Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5648426rdb; Wed, 13 Dec 2023 15:24:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBd9z181S8tVeYQ5dL9V2Fag0Jf3u+bEb6p/xCMySWpv6U8ZEHOUL/OyWWTQDBc1WLXcn4 X-Received: by 2002:a05:6808:238d:b0:3b9:ddbc:621c with SMTP id bp13-20020a056808238d00b003b9ddbc621cmr10934267oib.44.1702509865642; Wed, 13 Dec 2023 15:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702509865; cv=none; d=google.com; s=arc-20160816; b=nWVGv/DTe8VB1aE2CWxF0JPjAmdU4S5OkgVhOGN2ZsJMPaHPwohC3vx+80j2X+Zad+ phYN5x3g1u9lQI4ZgrhC0OzHe5rb+RkY25B8M7n/F8AnWPvB6RiIsbKoPJ9USX3zixY3 /en9I68LVcRmsG39ApZbEYL8l2RjCCqDUTnB9w9CSvY+UQjV8VIjKH2bEV3CtChmT8Nc HJsO4VZrpwOMF0wTaev+Zs/mA6Wua5aYAKtbT50cL7ZWkXet9i2+TRlLLXmW3/Fm0/ii MxUtto8zkoidmnZxaZA+s9PQQXA/3EO/8AdXzlOgrOA9PaqB3Qp/X2GDW5MRzNOgbu7u nIHg== 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 :message-id:date:subject:cc:to:from; bh=CZ83+62UCHjjRtkxH1Vq6x/uYenktHs5wP14ittGGAQ=; fh=gFvq9z70Lb98xGfWcbm1LAG2CzHqHZPq6D/+7cw21fk=; b=clu11nvU1rqW7HM+m9KBwdTdGZ/j3zsR80fFW1o+nZjilprNlaY97L9oIriMePT8mq jfgtMVm0DGb1P+UkdMCNozUScv5gz0M1z3B9ShnBhijuGvEXJjtg65TRL7S31JF3M7fH bEx8ZrHU1BRVgJfcfPJNhsAZz2NzK5bfzb2yMqKxHSSbMJIigvjjmbM2mlZCVY4rRHR3 rxE37e7v1s/2USrPHPRVmYXWSnmgdggVEq+pJK9zq/x1BT5q+Qe0KXUYrov6UyxSQlfs MYrpzncTAG7WLDrNEVlWRj+WS2yMiDYOrmASlgImwetpvM4Q5I2+sEqL5nF+OouRbsy6 s7XQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id t3-20020a62d143000000b006ce9e6c0ebbsi10199712pfl.361.2023.12.13.15.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:24:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 241F9827D0D4; Wed, 13 Dec 2023 15:24:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230050AbjLMXYI (ORCPT + 99 others); Wed, 13 Dec 2023 18:24:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjLMXYH (ORCPT ); Wed, 13 Dec 2023 18:24:07 -0500 Received: from irl.hu (irl.hu [95.85.9.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2627A3 for ; Wed, 13 Dec 2023 15:24:13 -0800 (PST) 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 0000000000070634.00000000657A3D19.0012843F; Thu, 14 Dec 2023 00:24:09 +0100 From: Gergo Koteles To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Gergo Koteles Subject: [PATCH] ALSA: hda/tas2781: call cleanup functions only once Date: Thu, 14 Dec 2023 00:23:58 +0100 Message-ID: <6089322f3d5f2e56f4d7a5899d70da2bc45978f7.1702509741.git.soyer@irl.hu> X-Mailer: git-send-email 2.43.0 Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 15:24:23 -0800 (PST) If the module can load the RCA but not the firmware binary, it will call the cleanup functions. Then unloading the module causes general protection fault due to double free. Do not call the cleanup functions in tasdev_fw_ready. general protection fault, probably for non-canonical address 0x6f2b8a2bff4c8fec: 0000 [#1] PREEMPT SMP NOPTI Call Trace: ? die_addr+0x36/0x90 ? exc_general_protection+0x1c5/0x430 ? asm_exc_general_protection+0x26/0x30 ? tasdevice_config_info_remove+0x6d/0xd0 [snd_soc_tas2781_fmwlib] tas2781_hda_unbind+0xaa/0x100 [snd_hda_scodec_tas2781_i2c] component_unbind+0x2e/0x50 component_unbind_all+0x92/0xa0 component_del+0xa8/0x140 tas2781_hda_remove.isra.0+0x32/0x60 [snd_hda_scodec_tas2781_i2c] i2c_device_remove+0x26/0xb0 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 fb802802939e..c6b292606dfa 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -550,11 +550,6 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context) tas2781_save_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_priv->codec_lock); if (fmw) release_firmware(fmw); base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa -- 2.43.0